dvalters / fuse-netcdf

ESoWC project to develop a Python utility to mount NetCDF files as a file-system in user space. (FUSE)
Other
8 stars 3 forks source link

ls and stat should return error on files/dirs that don't exist in the virtual filesystem #16

Closed dvalters closed 6 years ago

dvalters commented 6 years ago

I.e. If we mount the NetCDF file and cd into a variable dir for example, stat falsefile returns output. Running ls falsefile just prints the name of the "fake file"

[dav@localhost blh]$ stat falsefile
  File: falsefile
  Size: 22165040    Blocks: 0          IO Block: 4096   regular file
Device: 2eh/46d Inode: 36          Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/     dav)   Gid: ( 1000/     dav)
Context: system_u:object_r:fusefs_t:s0
Access: 2018-07-27 17:51:17.563942193 +0100
Modify: 2018-06-14 20:25:11.128244876 +0100
Change: 2018-06-14 20:25:11.128244876 +0100
 Birth: -
[dav@localhost mntpoint]$ ls foobar
foobar
dvalters commented 6 years ago

Made a start at this with https://github.com/dvalters/fuse-netcdf/commit/4d92bfbdd6401fbcc854341ff833eef6c09ee81c but still incorrect behaviour in variable subdirs. (Because self.internalpath is var/attrwhich is caught by one of the if statements ingetattr`

dvalters commented 6 years ago

Closed by https://github.com/dvalters/fuse-netcdf/commit/5243944a88fd2dc25cea186c14021a63e7a5ff07