On 21 mars 06, at 18:44, Jerry Fritschle wrote:

My application allows the user to select files to go to an FTP server. I've just added a method to check the file's name for illegal characters, that will make the server gag (the forward slash is the biggie, but I'm applying all the Windows character rules.)

When such a file is encountered, the user is presented with a dialog, giving the option to rename the file or skip it (the renaming button is only enabled if the file is not locked.)

The renaming button's Action basically goes:

Folderitem.name=ReplaceAllB(Folderitem.name, "/", "-")

...and so on through the illegal characters.

This works on OS X, but not on OS 9 (my Windows version does not bother with it because such a name could not exist anyway.) I've also tried ReplaceAll instead of ReplaceAllB. I've also tested this on a "real" OS 9 machine--i.e, not just in Classic mode.

I suppose in such a case I could create a copy of the file with a legal name, but for now I'm curious where I'm going wrong, at least as far as 9 is concerned.

Strange.
What reveals the LastErrorCode property of the FolderItem?
(By the way: you may keep a copy of the name in a variable, process the variable and then assign the name back from the variable, so you avoid setting the name for every replaceAll (setting the name uses the filesystem)).

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to