[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

stripping characters during copy process? Problem mp3 filenames



I have a bunch of cdroms containing mp3's that I want to copy from the
cdrom to a vfat partition on a mounted drive on my network. For
completeness let me say that the drive is a hard drive in an enclosure
connected via usb. Using a simple cp command I get error messages, not
sure what they mean. Here is an example:

keith@t520:~/evesdb4/mp3/misc$cp -vr /media/cdrom0/*.mp3 ./
`/media/cdrom0/01 Zephyr & I.mp3' -> `./01 Zephyr & I.mp3'
cp: reading `/media/cdrom0/01 Zephyr & I.mp3': Input/output error
cp: failed to extend `./01 Zephyr & I.mp3': Input/output error
`/media/cdrom0/01 All I Want To Do.mp3' -> `./01 All I Want To Do.mp3'
cp: reading `/media/cdrom0/01 All I Want To Do.mp3': Input/output error
cp: failed to extend `./01 All I Want To Do.mp3': Input/output error

I am assuming (maybe incorrectly) that the problem has to do with the
spaces and special characters in the filenames.

Maybe a correct use of quotes would help the globbing problem?

But my preference would be to use a command syntax or small script that
would replace all the non-aphanumeric characters with an underscore as
well as change the case to all lower case during the copy process.

I've looked around and can find lots of suggestions using some combination
of rename, awk, sed, find, etc but I can't seem to apply them to my
situation because I can't write to the cdrom and because I'm dealing with
a vfat partition, not ext. I have thousands of these mp3's. And they are
in multiple layers of subdirectories.

There is some good discussion of the problems involved at this web page:

http://stackoverflow.com/questions/152514/how-to-rename-all-folders-and-files-to-lowercase-on-linux

but again due to my lack of knowlege/experience I am not able to put
together a working solution from those discussions.

Care to help?

Thanks,
Keith Ostertag


Reply to: