Re: case-sensitivity of Mma & case-insensitity w/ Windows & DOS
- To: mathgroup at yoda.physics.unc.edu
- Subject: Re: case-sensitivity of Mma & case-insensitity w/ Windows & DOS
- From: John Fultz <jfultz>
- Date: Tue, 12 Apr 1994 03:52:07 -0500 (CDT)
> > I've run into a problem using ReadList[]. I think it would also happen with > other Mma functions that attempt to import or export data. I'm running Mma > 2.2 under Windows 3.1. Windows shows all files and directories (regardless > of how it was typed in) in lower case. DOS shows everything in upper case. > I have discovered, however, that ReadList["c:\data\file1"] expects precisely > that, and is not interchangeable with ReadList["c:\data\File1"] or > ReadList["c:\Data\file1"] for > instance. Now under DOS or Windows, one can't tell what case was used when > the file or directory was created, so I'm reduced to guessing which letters > of the directory and file name should be in upper case. Has anyone else run > into this problem? Is there a way to get Windows to show the case of > directories or files as they were actually entered? Many thanks in > advance!!! - J.P. Purswell > > I doubt that the problem you're running into is case-sensitivity. One thing many Windows and DOS users don't realize when loading files is that any time you put a backslash inside of double-quotes, it is considered an escape character and cannot be used obliviously, similar to the % character inside of a C printf() command. See page 370 of the Mathematica book for more details. The reason that it sometimes works is that a backslash+character which is not a valid escape code is interpreted as a literal backslash plus the character. In your specific example, the \f in "c:\data\file1" actually translates into a form feed. Little wonder Mathematica doesn't pick it up correctly. However, \F translates into \F because it has no assigned escape code. The simple fix is to always use \\ when referring to a literal backslash in a string; for example, "c:\\data\\file1". Hope this helps! -John -------------------------------------------------------------------------------- John Fultz "I am not a mouthpiece for Wolfram Research." jfultz at wri.com "Goldfish schoals, nibblin' at my toes, Fun, fun, fun..." --------------------------------------------------------------------------------