Click to See Complete Forum and Search --> : case conversion?


2thumbs
12-19-2000, 09:47 PM
http://www.linuxnewbie.org/ubb/mad.gif damn it. I had backed up all my AQ2 files on a bunch of CD-RW's. Now I copied them back onto my linux drive and the dumb bastard has over half of them in uppercase (plus all the frikken files are set chmod +x for some stupid reason) and Q2 seems to choke on upper case files http://www.linuxnewbie.org/ubb/mad.gif. The executable bit thing isn't much of a problem since I can use chmod -x *.* the frikken directory. But (and I feel really stupid asking this since I should know it hehe), how do I convert all the files in a directory to lower case in one step (recursively through all directories would be even nicer http://www.linuxnewbie.org/ubb/wink.gif ) ? Renaming several thousand files to lower case isn't my idea of a good time. I tried to pop them all into a zip file and told unzip to convert to lowercase, but that doesnt seem to work. Any ideas? thnx

[This message has been edited by 2thumbs (edited 19 December 2000).]

2thumbs
12-19-2000, 10:07 PM
Hmm.. I put all of the 2GB of crap onto my w2k box, then moved them over to the linux box using samba http://www.linuxnewbie.org/ubb/smile.gif I guess those gigabit cards/hub payed off http://www.linuxnewbie.org/ubb/wink.gif

ph34r
12-19-2000, 10:51 PM
I don't know enough about it to tell you exactly what code you need, but you can write perl and regular express it to do exactly what you want.


Btw - I'd recommend making links to a lot of it so you have 2 versions (1 caps 1 not), as some of the fsckin idiots who made AQ2 maps used MiXEdCaSe filenames. This is especially bad with textures, so if you are missing those after a restore, you know to check the console log for the FNF errors.


How do I know this? I wiped my AQ2 stuff out once too... I feel for ya.

[This message has been edited by ph34r (edited 19 December 2000).]

zGoRNz
12-21-2000, 09:32 PM
#!/usr/bin/perl -w
foreach $file (`/bin/ls`) {
chomp $file;
$new = $file;
$new =~ tr/A..Z/a..z/;
`ln -s $file $new`;
}

put that in a file and chmod +x it, then run it from the directory with the upper cased names, this keeps them but makes symlinks to them with lowercase, i've never tried this, never played quack 2, but i know perl :-D

- gorn out -

------------------
Dunt Dunt Duh...
GoRN To The Rescue,
Yet Again
zGoRNz@yahoo.com
aim: GoRNToTheRescue