English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Scripting (https://eab.abime.net/forumdisplay.php?f=117)
-   -   AmigaDOS illegal character in filenames (https://eab.abime.net/showthread.php?t=65927)

rare_j 20 September 2012 01:05

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

prowler 20 September 2012 01:36

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.

thomas 20 September 2012 08:06

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.

prowler 20 September 2012 21:18

Well, that's a couple of new things I've learned today. :) Thanks Thomas! :bowdown

rare_j 21 September 2012 16:35

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!


All times are GMT +2. The time now is 17:15.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04120 seconds with 10 queries