rclone/cmd/cmount
Nick Craig-Wood 4ac662d144 cmount: fix macOS losing directory contents #4393
Before this change when reading directories we would use the directory
handle and the Readdir(-1) call on the directory handle. This worked
fine for the first read, but if the directory was read again on the
same handle Readdir(-1) returns nothing (as per its design).

It turns out that macOS leaves the directory handle open and just
re-reads the data from it, so this problem causes directories to start
out full then subsequently appear empty.

macOS/OSXFUSE is passing an offset of 0 to the Readdir call telling
rclone to seek in the directory, but we've told FUSE that we can't
seek by always returning ofst=0 in the fill function.

This fix works around the problem by reading the directory from the
path each time, ignoring the actual handle. This should be no less
efficient.

We will return an ESPIPE if offset is ever non 0.

There are possible corner cases reading deleted directories which this
ignores.
2020-07-24 15:38:08 +01:00
..
fs.go cmount: fix macOS losing directory contents #4393 2020-07-24 15:38:08 +01:00
mount.go cmount: always supply stat information in Readdir 2020-07-24 15:12:05 +01:00
mount_test.go Revert "mount2,cmount: skip unreliable tests #4171" 2020-06-30 12:01:36 +01:00
mount_unsupported.go Use build tags to control when and where cmount is built 2017-05-19 17:08:04 +01:00