havardgulldahl / jottalib

A library to access files stored at jottacloud.com.
GNU General Public License v3.0
83 stars 19 forks source link

Handle Jottacloud's case-insensitive API #15

Open goddva opened 9 years ago

goddva commented 9 years ago

It seems that Jottacloud is using a case-insensitive filesystem, so if you have two files with the same name, but different case, it will only upload the first file. It will however tell that the second file was uploaded, but its not visible on the Jottacloud. Now after each new run, it will tell that the file was uploaded, even if it was not.

havardgulldahl commented 9 years ago

Yikes. That's crazy.

havardgulldahl commented 9 years ago

But you're right, I can confirm the madness.

Maybe since they started out with windows, that's why the servers don't care about case. But I wonder what the mac os client does about this if the file system is case sensitive.

goddva commented 9 years ago

The Mac client is having the same problem. I tested with an external disk formated with "Mac OS Extended (Case-sensitive, journal)", placed four files in a folder, all with the same name, just different case. Only one file was uploaded.

fatso83 commented 9 years ago

It's crazy that the server side works that way, but none of the supported client operating systems are case sensitive, so it's not that strange this hasn't been a priority for them. As you can see from this thread, HFS+ (OS X) is case-preserving, but not case sensitive. It can be configured to be case-sensitive, though.

Same thing for Windows: NTFS is case sensitive, but the Win32 API won't let you create files that only differ by case.

So crazy, but not that crazy :-)

havardgulldahl commented 9 years ago

Ok, so we'll have to fix this on the client end, and make the tools do something clever. Thanks for your comments, guys.

havardgulldahl commented 9 years ago

Here's what we'll do.

From https://mail.python.org/pipermail/python-dev/2009-May/089524.html

>> Or you can just be practical and test for it. Create a file "foobar" and see if
>> you can open "FOOBAR" in read mode...
> 
> Agreed.  That is how Bazaar's test suite detects this, and it works well.
> 
> -Andrew.
Actually, I believe we do:
open('format', 'wb').close()
try:
    os.lstat('FoRmAt')
    casesens = True
except IOError, e:
    if e.errno == errno.ENOENT:
        casesens = False
havardgulldahl commented 8 years ago

Move to milestone 0.5

havardgulldahl commented 8 years ago

Move to milestone 0.6