|
|
| Don't ask to ask, just ask | |
| PerlMonks |
how to get the parent directory name?by juro (Initiate) |
| on Dec 08, 2006 at 06:37 UTC ( [id://588566]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.juro has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I'm fairly new to perl, and have difficulties to get the parent diretory name.
What I want to do is: I have a very large collection of music files from which a vast amount neither is tagged correctly or tagged at all. Also their file name is not right. But I do now that the directory structure is right. The 1st dir is artist, this contains subdirs with the albums, and the filenames contains at least the trackname but sometimes also other info. (ie: /Celtic Frost/Into The Pandemonium/02\ -\ Mesmerized.mp3 So I need a script that reads a files name, the name of it's parent directory and the directory above that, and than examins the file name to substract the trackname. That results in 3 variabels from which I can correctly rename the file, and tag the file. From wihtin the example directory above I tried : Clearly that does not work.
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||||