yadayada / acd_cli

An unmaintained command line interface and FUSE filesystem for Amazon (Cloud) Drive
Other
1.35k stars 167 forks source link

Finder (Mac os) fails to paste a file in mountpoint #533

Open jmascart opened 7 years ago

jmascart commented 7 years ago

Hello, I use acd_cli on Linux and Mac OS. On Linux i have no problem, but on Mac i can't paste files in the mountpoint with Finder. The cp command works, but i'd like to paste from Finder.

I tried to remove the xattrs from a file but it doesn't make the paste work.

The error in Finder:

screen shot 2017-02-15 at 02 41 31
jma@MacBook:\~$ python3 -c 'import platform as p; print("%s\n%s" % (p.python_version(), p.platform()))'
3.5.2
Darwin-16.4.0-x86_64-i386-64bit
jma@MacBook:\~$ acdcli version
acd_cli 0.3.2, api 0.9.2

If it may help, here is a log when i copy an image with cp command, and when i try to copy/paste the exact same file with finder

cp.log.txt copy-paste-in-finder.log.txt

jmascart commented 7 years ago

I'm not sure if it's the same problem or not, but Finder makes a lot of getattr calls when he is writing a file into an acdcli mountpoint. But getattr will return a size of 0, although some datas have already been written.

I don't know if it confuses Finder, but for sure it confuses OSXFUSE: "if osxfuse detects a change in a file's size during getattr(), it will purge that file's buffer cache." (source https://github.com/osxfuse/osxfuse/wiki/Mount-options).

I can reproduce that if a program is making write calls, and another program makes a getattr() on the file that returns a 0 size, the next write received by the fuse implementation will have an offset reseted to zero. acdcli doesn't like it and says "illegal seek".

So maybe the problem is with OSXFUSE ?