コード例 #1
0
ファイル: gdfuse.py プロジェクト: He1my/GDriveFS
    def utimens(self, raw_path, times=None):
        """Set the file times."""

        if times is not None:
            (atime, mtime) = times
        else:
            now = time()
            (atime, mtime) = (now, now)

        (entry, path, filename) = self.__get_entry_or_raise(raw_path)

        mtime_phrase = get_flat_normal_fs_time_from_epoch(mtime)
        atime_phrase = get_flat_normal_fs_time_from_epoch(atime)

        self.__log.debug("Updating entry [%s] with m-time [%s] and a-time "
                         "[%s]." % (entry, mtime_phrase, atime_phrase))

        try:
            entry = drive_proxy('update_entry',
                                normalized_entry=entry,
                                modified_datetime=mtime_phrase,
                                accessed_datetime=atime_phrase)
        except:
            self.__log.exception("Could not update entry [%s] for times." %
                                 (entry))
            raise FuseOSError(EIO)

        self.__log.debug("Entry [%s] mtime is now [%s] and atime is now "
                         "[%s]." %
                         (entry, entry.modified_date, entry.atime_byme_date))

        return 0
コード例 #2
0
ファイル: gdfuse.py プロジェクト: HostSuki/GDriveFS
    def utimens(self, raw_path, times=None):
        """Set the file times."""

        if times is not None:
            (atime, mtime) = times
        else:
            now = time()
            (atime, mtime) = (now, now)

        (entry, path, filename) = self.__get_entry_or_raise(raw_path)

        mtime_phrase = get_flat_normal_fs_time_from_epoch(mtime)
        atime_phrase = get_flat_normal_fs_time_from_epoch(atime)

        self.__log.debug("Updating entry [%s] with m-time [%s] and a-time "
                         "[%s]." % (entry, mtime_phrase, atime_phrase))

        try:
            entry = drive_proxy('update_entry', normalized_entry=entry, 
                                modified_datetime=mtime_phrase,
                                accessed_datetime=atime_phrase)
        except:
            self.__log.exception("Could not update entry [%s] for times." %
                                 (entry))
            raise FuseOSError(EIO)

        self.__log.debug("Entry [%s] mtime is now [%s] and atime is now "
                         "[%s]." % (entry, entry.modified_date, 
                                    entry.atime_byme_date))

        return 0
コード例 #3
0
    def utimens(self, raw_path, times=None):
        """Set the file times."""

        if times is not None:
            (atime, mtime) = times
        else:
            now = time()
            (atime, mtime) = (now, now)

        (entry, path, filename) = get_entry_or_raise(raw_path)

        mtime_phrase = get_flat_normal_fs_time_from_epoch(mtime)
        atime_phrase = get_flat_normal_fs_time_from_epoch(atime)

        gd = get_gdrive()

        try:
            entry = gd.update_entry(
                        entry, 
                        modified_datetime=mtime_phrase,
                        accessed_datetime=atime_phrase)
        except:
            _logger.exception("Could not update entry [%s] for times.",
                              entry)

            raise FuseOSError(EIO)

        return 0