Hi,
This may not be strictly a Squeak question - but hopefully I will be excused... We are trying to put together a small Squeak application which reads and displays large data files stored on a UNIX machine. While attempting to port the application to Windows we find that the UNIX filenames of the form -> '2002_07_20_05:21:44.fits' cannot be used as they are as Windows converts them to something else. Is there anyway to anticipate what the equivalent Windows file name will be??
thanks Rosalind
Ezhil,
Windows file names cannot contain certain characters and the colon is one of them (colons are used for "special" file names like "COM1:", "LPT1:" etc). From your description, it is not entirely clear to me what you mean by "anticipating what the equivalent Windows file name will be". If the file is created by Squeak, then these characters will be replaced by hashmarks (#) and a file name like "foo:bar" would come out as "foo#bar" (this is a standing rule on which you can rely). However, if you mean that these files are copied to a Windows machine and get replaced during this process then it depends on the mechanism you use for copying. This is something you need to investigate and I can't be of help here.
Generally, it is best not to use common special characters in file names (colons, slashes etc). If you can (for example) replace the colons with a minus life will be much easier for you ;-)
Cheers, - Andreas
-----Original Message----- From: squeak-dev-admin@lists.squeakfoundation.org [mailto:squeak-dev-admin@lists.squeakfoundation.org] On Behalf Of Ezhil Sent: Sunday, August 11, 2002 5:52 PM To: squeak-dev@lists.squeakfoundation.org Subject: newbie question
Hi,
This may not be strictly a Squeak question - but hopefully I will be excused... We are trying to put together a small Squeak application which reads and displays large data files stored on a UNIX machine. While attempting to port the application to Windows we find that the UNIX filenames of the form -> '2002_07_20_05:21:44.fits' cannot be used as they are as Windows converts them to something else. Is there anyway to anticipate what the equivalent Windows file name will be??
thanks Rosalind
Andreas Raab wrote:
Ezhil,
Windows file names cannot contain certain characters and the colon is one of them (colons are used for "special" file names like "COM1:", "LPT1:" etc). From your description, it is not entirely clear to me what you mean by "anticipating what the equivalent Windows file name will be". If the file is created by Squeak, then these characters will be replaced by hashmarks (#) and a file name like "foo:bar" would come out as "foo#bar" (this is a standing rule on which you can rely). However, if you mean that these files are copied to a Windows machine and get replaced during this process then it depends on the mechanism you use for copying. This is something you need to investigate and I can't be of help here.
Generally, it is best not to use common special characters in file names (colons, slashes etc). If you can (for example) replace the colons with a minus life will be much easier for you ;-)
Colons are illegal in Winders because they are needed for mount-points (C:). con, com#, lpt#, nul, and a few other magical names are interpreted by DOS VFS to redirect to a driver, and you can crash any Win9x box by accessing C:\nul\nul (fun fact from E2!). Many other characters are taken by command.com (and Explorer) to be special metacharacters, and are made illegal rather than giving an \escape character. If you're exporting the files through samba, it might support decent control of mangling (though I couldn't find it). If the files don't move around too much, you could also make a seperate directory tree of just symlinks, and mangle the names of the links.
Thankyou Andreas and Brian. I am sorry my post was not very clear. The data files are not written using Squeak. I am trying to use Squeak to extract and analyse information from existing data files using Squeak on Windows. There is no way I can change the way filenames are written either. By asking if I could 'anticipate' - I meant that when I know the name of the file I want to look at - I see on Windows NT explorer that the names are displayed differently and cannot tell which file is the one I am looking for. So I was wondering if I could tell how the conversion went. Anyway, I understand that the colons in the file names are causing the problem and that Samba is doing the conversion! Unfortunately creating symlinks for the files is not an option for us as hundreds of files are newly created everyday.
thanks again Ezhil
On Sun, 11 Aug 2002, Brian Keefer wrote:
Andreas Raab wrote:
Ezhil,
Windows file names cannot contain certain characters and the colon is one of them (colons are used for "special" file names like "COM1:", "LPT1:" etc). From your description, it is not entirely clear to me what you mean by "anticipating what the equivalent Windows file name will be". If the file is created by Squeak, then these characters will be replaced by hashmarks (#) and a file name like "foo:bar" would come out as "foo#bar" (this is a standing rule on which you can rely). However, if you mean that these files are copied to a Windows machine and get replaced during this process then it depends on the mechanism you use for copying. This is something you need to investigate and I can't be of help here.
Generally, it is best not to use common special characters in file names (colons, slashes etc). If you can (for example) replace the colons with a minus life will be much easier for you ;-)
Colons are illegal in Winders because they are needed for mount-points (C:). con, com#, lpt#, nul, and a few other magical names are interpreted by DOS VFS to redirect to a driver, and you can crash any Win9x box by accessing C:\nul\nul (fun fact from E2!). Many other characters are taken by command.com (and Explorer) to be special metacharacters, and are made illegal rather than giving an \escape character. If you're exporting the files through samba, it might support decent control of mangling (though I couldn't find it). If the files don't move around too much, you could also make a seperate directory tree of just symlinks, and mangle the names of the links.
Rosalind Ezhil writes
I am trying to use Squeak to extract and analyse information from existing data files using Squeak on Windows.
I suggest use the following
| path |
path _ FileList2 modalFolderSelector. FileDirectory setDefaultDirectory: path pathName.
Work on any file and plattform
Edgar De Cleene
Hi Ezhil,
Ezhil wrote:
Hi,
This may not be strictly a Squeak question - but hopefully I will be excused... We are trying to put together a small Squeak application which reads and displays large data files stored on a UNIX machine. While attempting to port the application to Windows we find that the UNIX filenames of the form -> '2002_07_20_05:21:44.fits' cannot be used as they are as Windows converts them to something else. Is there anyway to anticipate what the equivalent Windows file name will be??
thanks Rosalind
Any reasonably recent mtools manpage will give you a quite good overview of standard filename manglings. Have to make sure that your mechanism uses the same standards (as Andreas mentioned there might be differences).
<Quote> As you see, the following transformations happen to derive a short name:
* Illegal characters are replaced by underscores. The illegal characters are ;+=[]',"*\<>/?:|.
* Extra dots, which cannot be interpreted as a main name/extension separator are removed
* A ~n number is generated,
* The name is shortened so as to fit in the 8+3 limi tation
The initial Unix-style file name (whether long or short) is also called the primary name, and the derived short name is also called the secondary name. </quote>
HTH, Torge
squeak-dev@lists.squeakfoundation.org