Skip to content

Commit ab239e6

Browse files
committed
Skip lookup of ".DS_Store" files or files with "._" prefix on darwin.
Signed-off-by: Thomas Hallgren <[email protected]>
1 parent 96ba24c commit ab239e6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/fs/ftp.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,12 @@ func (f *fuseImpl) Flush(path string, fh uint64) int {
197197
// UID and GID of the caller. File mode is always 0644 and Directory
198198
// mode is always 0755.
199199
func (f *fuseImpl) Getattr(path string, s *fuse.Stat_t, fh uint64) int {
200+
if runtime.GOOS == "darwin" {
201+
fn := filepath.Base(path)
202+
if fn == ".DS_Store" || strings.HasPrefix("._", fn) {
203+
return -fuse.ENOENT
204+
}
205+
}
200206
log.Debugf("Getattr(%s, %d)", path, fh)
201207
var e *ftp.Entry
202208
var errCode int

0 commit comments

Comments
 (0)