English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System > Coders. Scripting

 
 
Thread Tools
Old 20 September 2012, 01:05   #1
rare_j
Zone Friend
 
rare_j's Avatar
 
Join Date: Apr 2005
Location: London
Posts: 1,176
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
rare_j is offline  
Old 20 September 2012, 01:36   #2
prowler
Global Moderator
 
prowler's Avatar
 
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.
prowler is offline  
Old 20 September 2012, 08:06   #3
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
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"
Note that square brackets are wildcards in AmigaDOS, too, so to replace () by [] will not help.
thomas is offline  
Old 20 September 2012, 21:18   #4
prowler
Global Moderator
 
prowler's Avatar
 
Join Date: Aug 2008
Location: Sidcup, England
Posts: 10,300
Well, that's a couple of new things I've learned today. Thanks Thomas!
prowler is offline  
Old 21 September 2012, 16:35   #5
rare_j
Zone Friend
 
rare_j's Avatar
 
Join Date: Apr 2005
Location: London
Posts: 1,176
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.
rare_j is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:32.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.18829 seconds with 15 queries