--never mind ...
--i think if i can figure out how to put it in double quotes, it'll work just fine. --thanks anyways. -X -----Original Message----- Subject: RE: how to parse filenames with spaces using regex --UPDATE: --Thanks for the help. I think I'm close, but I think I ran a snag: --When I try to mount the iso image, I get an error: [snip] [root@hmp perl]# mount -rt iso9660 -o loop /samba/hmp/iso/03/UNASSIGNED-03 - DUMMY-03.iso /t Usage: mount -V : print version mount -h : print this help mount : list mounted filesystems mount -l : idem, including volume labels So far the informational part. Next the mounting. The command is `mount [-t fstype] something somewhere'. [/snip] --But check this out: you see the name of the file? It wants to be mounted like this: [snip] mount -rt iso9660 -o loop /samba/hmp/iso/03/UNASSIGNED-03\ -\ DUMMY-03.iso /t [/snip] --Check that part out with the "\" and the spaces. The above works, but not what we were working on. I was trying to see test something: [script] foreach my $file ( split (/\n/, `ls -d1 $sambadir/*` ) ) { print "we see file :$file:\n"; #$file=(split(//, $sambadir/$file) ); print "$sambadir/$file"; system ("/bin/mount -rt iso9660 -o loop $file $mount_pnt"); #chdir ("$mount_pnt"); #system ("cp $mount_pnt/* $padir/$region[0]/"); # don't need to open, just mount and copy print "\n# - thus end the reign of terror of \$file $file-\n\n"; } [/script] --I thought that using the readdir would work, and it did bring up a list of files, but they are not broken up by the "\". bummer. I'm hitting myself in the head with a hammer because I believe that using the "readdir" and "split (/\n/, `ls -d1 $sambadir/*)" are doing the same thing. But I don't think that they are. --So I know this is silly, but how can I figure out exactly what the DOS files want (including the "\" and spaces) and mount them as-is? --I apologize if the explaination isn't crystal clear. If I need to go into more detail, please let me know. --Thanks! -X -----Original Message----- From: drieux [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 30, 2002 5:27 PM On Thursday, May 30, 2002, at 01:40 , Johnson, Shaunn wrote: > Question about capturing a file name with > spaces using regular expressions. [..] > The output looks like this (the result of just $group). > > [snip example] > > /samba/hmp/iso/06/UNASSIGNED-06 - DUMMY-06.iso > > [/snip example] > > My goal is to print "UNASSIGNED-06 - DUMMY-06.iso" (and > then later on cut out the .iso part). If I can do that, > then I think I can do the rest. > > Suggestions? perldoc -f readdir Remember that the 'directory' portion is not in the 'dirBlock' itself - only the names of files.... traditionally we do my $demDir = '/Users/drieux/tmp/Junk'; opendir(DIR, $demDir) or die "unable to open Dir $demDir:$!\n"; my @files = grep { $_ ne '.' and $_ ne '..' } readdir(DIR); close(DIR); foreach my $file (@files) { print "we see file :$file:\n"; open(FH, "$demDir/$file") or die "funny I can not open $file:$! \n"; print $_ while <FH>; close FH; print "\n# -thus endeth the reading of \$file $file-\n\n"; } [snip]