in reply to Re^2: move command
in thread move command

Windows has no problems with lowercase letters

Unfortunately it does. Try to create a file "FOO.TXT", and then create a new file "foo.txt". You will find that the second file "replaces" the first one. The reason is that Windows internally does not distinguish between lower and upper case. Well, this applies to Windows until XP. I don't know whether this has been fixed in Vista.

and fewer problems than unix with the dash

Partially true. Strictly speaking, Unix has no problem with dash, but you likely mean that the vast majority of Unix command line tools use the dash to denote switches, while the majority of Windows command line tools use a slash to denote a switch. Since there are still quite a few Windows utilities which also use a hyphen to denote a command line switch, you should avoid on Windows files starting with either a hyphen or a slash, while on Unix you will have a happier life if you don't have files starting with a hyphen, and a slash is ruled out as valid character anyway.

Underscores, AFIK, are no problems in either OS. In Windows, there are some characters which you should avoid, since they have special meaning to the shell: caret (^), percent (%), double quotes ("), parentheses. Caret and percent are fine on Unix, but the others are better avoided there too. While Unix itself is tolerant on most characters, many of the shells on Unix have their own special characters, such as a tilde (~) on the starting position, or a $ sign.

On Unix, I try to avoid characters which are special to the most common shells (bash, zsh, tcsh), not because it would be strictly necessary, but because it makes life easier. Given that at least tcsh is available on Windows as well - though it seems to be much less in use than on Unix -, I avoid these characters on Windows too.

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^4: move command
by ikegami (Patriarch) on Jul 09, 2009 at 14:17 UTC

    What you seem to be missing is while Windows is case-insensitive, it does remember the case of the name. If you create FOO.TXT, it will show up as FOO.TXT in a directory listing. If you create foo.txt, it will show up as foo.txt. Your suggestion would limit me to creating uppercase file names and that would be awful.

    You will find that the second file "replaces" the first one

    Not quite. The first file will be truncated, but its name will still be FOO.TXT, not foo.txt.

      Your suggestion would limit me to creating uppercase file names and that would be awful.
      Or only lowercase. While this seems overly restrictive, at least you don't run into the problem that within your application you seem to have two files which are conceptionally different (such as Makefile and makefile), but end up being the same file on the OS level.

      But I see that to completely rule out upper (or lower) case is too restrictive. For example Perl .pm files are usually written in mixed case. Still, for the files I create, I try to stick to lower case letters unless the circumstances really beg for upper/mixed case.

      -- 
      Ronald Fischer <ynnor@mm.st>

        at least you don't run into the problem that within your application you seem to have two files which are conceptionally different (such as Makefile and makefile), but end up being the same file on the OS level.

        at least you don't run into the problem that within your application you seem to have two file names which are lexically identical (such as Makefile and makefile), but end up being the two different files on the OS level.

        It cuts both ways. If you really see this as a problem, you should cut out uppercase from unix usage too.

        I don't think case should be enforced programmatically in either environment. There are too many situations where mixed case might be seen as a benefit.

        I try to stick to lower case letters unless the circumstances really beg for upper/mixed case.

        In general, I tend to base it on who is the intended consumer. If it's a person, spaces and capitalisation are used. If it's a program, underscores and lowercase.