#83 Rename when only the case is different

closed-rejected
5
2008-06-23
2008-06-19
Gerard Krol
No

This explains it all:

gerard@gerard:~/davfsmount$ ls
A13
gerard@gerard:~/davfsmount$ mv A13 a13
mv: cannot move `A13' to `a13': Input/output error
gerard@gerard:~/davfsmount$ mv A13 a13_
gerard@gerard:~/davfsmount$ mv a13_ a13
gerard@gerard:~/davfsmount$ ls
a13

So perhaps it would be nice to check if the filenames for a rename only differ in case, and if so, first rename the file to something different?

$ mount.davfs --version
davfs2 1.3.0 <http://dav.sourceforge.net>

Discussion

  • Werner Baumann
    Werner Baumann
    2008-06-19

    Logged In: YES
    user_id=1260327
    Originator: NO

    This is not a davfs2 issue. It is a server issue. Your server cannot handle file names that differ only in case. So don't use file names that differ only in case.

    Please note:
    With WebDAV, clients running on different operating system and a server that may run on still another operating system exchange files. Every operating system has restrictions regarding characters in file names. You cannot expect that everything allowed on one system is allowed on another system. So play it safe. Avoid file names that are known to cause problems on some systems.

    If you insist in doing things like in your example, knowing that it does not work on many Windows systems, you will have to work aroud this by your own.

    I do not intend to implement work arounds for all that file name problems than can happen when different operating system interoperate. This job is already handled by Sisyphos.

    Additionally, davfs2 comes with documentation which explains the problem and gives advise how to avoid it.

    Cheers
    Werner

     
  • Werner Baumann
    Werner Baumann
    2008-06-19

    • labels: 341330 --> mount.davfs
    • assigned_to: nobody --> wbaumann
    • status: open --> open-rejected
     
  • Gerard Krol
    Gerard Krol
    2008-06-20

    Logged In: YES
    user_id=1136541
    Originator: YES

    Hi Werner,

    I'm not sure I entirely get your point. Any filesystem I know of that allows the mixing of case in a filename would accept the workaround. It is just that I had 30 files with a lowercase a and one with an uppercase (created in windows by the way). As I can rename the file to lowercase in windows, it seems reasonable that I should be able to do this from linux through davfs. I agree that this is a server problem. Too bad I can't change anything on the server.

    My solution would just be:
    * Try to rename the file
    * When it fails, check if they only differ in case
    * If so, add a random suffix to the name to create a valid temporary one
    * Rename the temporary name to the requested one

    Could you explain me the problems this might cause? If it really is a design decision to not work around buggy servers, I won't bother you with it. If you think it might be useful I could write a patch somewhere next week.

    By the way, thanks for the good work on dafvs, it does it's job well.

    And what is this Sysiphos? Google does not seem to know one that has anything to do with interoperability of operating systems.

    Regards,

    Gerard

     
  • Werner Baumann
    Werner Baumann
    2008-06-20

    Logged In: YES
    user_id=1260327
    Originator: NO

    For Sisyphos please look at http://en.wikipedia.org/wiki/Sisyphos.

    There are a lot of different restrictions regarding characters in file system on different operating systems, I don't even know all of them.

    The point: it is known that using file names that only differ in case does not work on windows systems. Your server runs on windows. It is very, very easy for you to avoid file names like this. Why do not simply avoid them, but instead think, somebody has to do a lot of work, to enable the use of this really pointless file names?

    And if you really can not live with this file name restrictions of windows, why not use another server.

    I do my best to work around server bugs. But I see no point in doing a lot of work to work around unecessary problems.

    One point about your proposal. It looks easy for you, because you only think of *your* problem.
    "* Try to rename the file
    * When it fails, check if they only differ in case"
    Why only check for "differ in case". There are one hundert other, easy to avoid possible reasons for failing. I would have to check for all of these and not only your case. That's the point about Sisyphos. And it would be no work for you at all.

    Cheers
    Werner

    P.S.: If you look at the davfs2 sources. There are far to many "if"s. Many ar work arounds about different server bugs as well as different server capabilities. And there are different library versions. Including all the possible work arounds for users ignoring file name restrictions will make the sources unmaintainable.

     
  • Gerard Krol
    Gerard Krol
    2008-06-23

    Logged In: YES
    user_id=1136541
    Originator: YES

    Ok, I understand your viewpoint. That's fine. I'm closing this bug.

     
  • Gerard Krol
    Gerard Krol
    2008-06-23

    • status: open-rejected --> closed-rejected