Beispiel #1
0
    def __init__(self, fs, inode):
        '''
        Constructor

        @raise IsADirectoryError:
        @raise ParentDirectoryMissing:
        @raise ParentNotADirectoryError:
        '''
        Inode.__init__(self, inode)

        self.fs = fs

        self._offset = 0

        self._freeSpace = None
        connect(self.freespace, "FS.freespace")
Beispiel #2
0
    def FS__init__(self, sender, db_file):
        self.db = initDB(db_file, join(dirname(abspath(__file__)), "..", "..", "pirannafs", "sql"))
        self.db.parse_dir(join(dirname(abspath(__file__)), "sql"), False, True)
        self.db.create(type=S_IFDIR)

        # Set the Dir objects to use the plugin database instance instead of
        # the filesystem main one
        BaseDir.db = self.db

        plugins.connect(self.link, "FS.link")
        plugins.connect(self.rename, "FS.rename")
        plugins.connect(self.unlink, "FS.unlink")

        plugins.connect(self._Get_Inode, "Dir._Get_Inode")

        module = sender.__class__.__module__
        if module == "pirannafs.backends.fuse":
            return backends.fuse.Dir
        if module == "pirannafs.backends.pyfilesystem":
            return backends.pyfilesystem.Dir
Beispiel #3
0
    def __init__(self):
        self.db = None

        plugins.connect(self.FS__init__, "FS.__init__")
        plugins.connect(self.readlink, "FS.readlink")
        plugins.connect(self.symlink, "FS.symlink")
Beispiel #4
0
def db_create(self):
    self.connection.execute('''
        CREATE TABLE IF NOT EXISTS log
        (
            link     INTEGER   PRIMARY KEY,

            deletion timestamp DEFAULT CURRENT_TIMESTAMP,

            FOREIGN KEY(link) REFERENCES links(id)
                ON UPDATE CASCADE
        )
    ''')


def db_unlinks(self, inode):
    '''
    Make a new file
    '''
    print >> sys.stderr, '*** db_log', inode

#    return self.connection.execute('''
#        INSERT INTO log(inode)
#        VALUES(?)
#        ''',
#        (inode,)).fetchone()


#plugins.connect(db_create,"FS.__init__")
plugins.connect(db_log)
Beispiel #5
0
    def __init__(self):
        self.db = None

        plugins.connect(self.FS__init__, "FS.__init__")
Beispiel #6
0
    def __init__(self):
        self.db = None
        self.ll = None

        connect(self.FS__init__, "FS.__init__")