20 September 2012, 01:05 | #1 |
Zone Friend
Join Date: Apr 2005
Location: London
Posts: 1,179
|
AmigaDOS illegal character in filenames
I'm trying to work on files and drawers that contain illegal characters in their names. Specifically, names containing brackets ()
Example: gametitle(publisher) If I list a folder with a title like this I get no results. Odd things happen when trying to work with files with titles like this. I tried to rename these items with the rename command but that fails. Rename via Workbench works, but that's no help in a script. How do you work with files with illegal characters in AmigaDOS? Thanks |
20 September 2012, 01:36 | #2 |
Global Moderator
Join Date: Aug 2008
Location: Sidcup, England
Posts: 10,300
|
You must use the wildcard '?' in your scripts instead of the illegal characters but, in the case you mention, you must make sure that gametitle?publisher? refers uniquely to the drawer gametitle(publisher) and not, for example, gametitle[publisher] as well.
|
20 September 2012, 08:06 | #3 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,033
|
Wildcards will help you to delete the badly named files but not much more.
Better you escape the offending characters with the ' sign. Code:
rename "gametitle'(publisher')" "gametitle-publisher" |
20 September 2012, 21:18 | #4 |
Global Moderator
Join Date: Aug 2008
Location: Sidcup, England
Posts: 10,300
|
Well, that's a couple of new things I've learned today. Thanks Thomas!
|
21 September 2012, 16:35 | #5 |
Zone Friend
Join Date: Apr 2005
Location: London
Posts: 1,179
|
Many thanks, I have learned something useful too.
To solve my problem, I am using a utility from aminet called case (util/cli/case.lha) which can remove lists of characters from filenames (amongst other things!). I just need to pass it a full list of amigados illegal characters. I know about ()[]~#?' Anyone know where can I find a full list of illegal (or inadvisable) filename characters? Thanks EDIT Scrap that, case has a -k option that strips everything from a filename except letters and numbers and a few other safe characters (dot dash etc.). Perfect! Last edited by rare_j; 21 September 2012 at 23:39. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
about filenames | orange | project.WHDLoad | 12 | 22 March 2010 17:14 |
HD Installers - now illegal? | rattus | Amiga scene | 20 | 29 September 2003 00:25 |
Illegal operation / BSOD | Retroid | support.WinUAE | 9 | 21 April 2002 16:57 |
illegal operation | Traquer | support.WinUAE | 12 | 08 April 2002 10:23 |
|
|