It looks like our Stat class was just reinitializing all of the things
that the built in fuse.Stat class already initializes, so just rely on
theirs, and use their keyword initializers to avoid a few more
reinitializations.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
sys.exit(1)
-class Stat(fuse.Stat):
- def __init__(self):
- self.st_mode = 0
- self.st_ino = 0
- self.st_dev = 0
- self.st_nlink = 0
- self.st_uid = 0
- self.st_gid = 0
- self.st_size = 0
- self.st_atime = 0
- self.st_mtime = 0
- self.st_ctime = 0
- self.st_blocks = 0
- self.st_blksize = 0
- self.st_rdev = 0
-
-
cache = {}
def cache_get(top, path):
parts = path.split('/')
log('--getattr(%r)\n' % path)
try:
node = cache_get(self.top, path)
- st = Stat()
- st.st_mode = node.mode
- st.st_nlink = node.nlinks()
- st.st_size = node.size() # Until/unless we store the size in m.
+ st = fuse.Stat(st_mode=node.mode,
+ st_nlink=node.nlinks(),
+ # Until/unless we store the size in m.
+ st_size=node.size())
if self.meta:
m = node.metadata()
if m:
WVPASSEQ "$result" "foo
pre-epoch"
+result=$(WVPASS cat mnt/src/latest/foo) || exit $?
+WVPASSEQ "$result" "content"
+
# Right now we don't detect new saves.
WVPASS bup save -n src -d "$savestamp2" --strip src
result=$(WVPASS ls mnt/src) || exit $?
result=$(TZ=UTC LC_ALL=C WVPASS ls -l mnt/src/latest/) || exit $?
readonly user=$(WVPASS id -un) || $?
readonly group=$(WVPASS id -gn) || $?
-WVPASSEQ "$result" "total 0
+WVPASSEQ "$result" "total 1
-rw-r--r-- 1 $user $group 8 Nov 11 2011 foo
-rw-r--r-- 1 $user $group 8 Jan 1 1970 pre-epoch"