1.71.5.204-B20160823
Hello.
So, you've got one of those new personal CD MP3 players, such as the Goodmans CDMP370. They're good, yeah? But -- all your MP3s have stupidly long file names and the CD player will only read ISO filenames of 31 characters or less, and MakeCD doesn't write the evil Joliet format. So, in order to burn a CD with ten hours of music, you need to rename all your MP3s to fit this limit. "Bah."
But no longer! This bit of ARexx generates a MakeCD filelist (see the MakeCD manual) which burns your MP3s with shorter names on the CD, without actually affecting the original files.
Only the one flaw - it doesn't check for duplicates, so:
"The Orb - The pulsating huge ever growing brain which rules from the centre
of the underworld (short mix).mp3"
"The Orb - The pulsating huge ever growing brain which rules from the centre
of the underworld (long mix).mp3"
would both be shortened to
"The pulsating huge ever gr.mp3"
Usage:
CDMP3_MakeCD.rexx <directory>
the list will be placed in Ram:MakeCD.listfile. Play with the script a bit before trying it out on a real CD.
---[ CDMP3_MakeCD.rexx ]--------------------------------------------
/* Generates a MakeCD filelist with shortened
* filenames (for 31 char RockRidge Level 2
* limit) but keeps the file extension.
* i.e., create an MP3 CD for Goodmans CDMP370.
*
* Neil Williams
*
neil@zeusdev.co.uk or
neil@tkgbbs.freeserve.co.uk
* Also 2:442/107 @ FidoNet
*/
parse arg filedir
options cache
options failat 99
options results
call addlib("rexxsupport.library",0,-30,0)
if( ~show( 'l', "rexxtricks.library" ) ) then do
if( ~addlib( "rexxtricks.library", 0, -30, 0 ) ) then do
say "Could not open rexxtricks.library"
exit 10
end
end
filecount = getdir( filedir, '#?', 'FILESRAW', 'FILES', 'PATH', 'SUBDIRS' )
if filecount>0 then do
if open( 'fh', 'Ram:MakeCD.listfile', 'w' ) then do
QSORT( 'FILESRAW', 'FILES', 'NOCASE' )
do i=1 to files.0
/* So, rexxtricks's FilePart() only supports 32 character filenames ...
*/
doh = 0
do j=0 to length( files.i )
if doh ~= 1 then
if left( right( files.i, j ), 1 ) = '/' then do
fn = right( files.i, j-1 )
doh = 1
end
end
if length( fn ) > 30 then do
fn = left( fn, length( fn )-4 )
fn = left( fn, 26 ) || '.mp3'
end /* if */
doh = 0
do j=0 to length( files.i )
if doh ~= 1 then
if left( right( files.i, j ), 1 ) = '/' then do
pn = left( files.i, length(files.i)-j+1 )
doh = 1
end
end
if index( pn, ':' ) ~= 0 then do
pn = right( pn, length( pn )-(index(pn, ':')) )
end
call writeln( 'fh', files.i || '::' || pn || fn )
end /* do */
close( 'fh' )
end /* open */
end /* if filecount */
---------------------------------------------------------
--
Neil Williams aka nOw2 - CompSci - Fido 2:442/107 - SysOp of TKG BBS
http://www.tkgbbs.freeserve.co.uk/ <- Links to most things
--- Mail Manager 1.22x/n #1511
# Origin: 9,600 bps (2:442/107.20)
* Origin: LiveWire BBS - Synchronet - LiveWireBBS.com (1:2320/100)