Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Perl script to edit file names only works if in file's folder?
I'm fairly new to Perl. I wrote a script to rename my mp3 files in a given folder based on their metadata tags. My script works, however it only works if the actual file is in the same folder as the given folder. How do I fix that so it can take in any folder without going in that folder?
I have it naming the files and including the given pathname, which is why it's puzzling.
2 Answers
- David KarrLv 49 years agoFavorite Answer
Any file operation specifies the path to the file. If it specifies a bare file name, the file is expected to be in the current directory. If the path is an absolute path, including directories, or a relative path including directories, then it can open a file that is not in the current directory.
- martinthurnLv 69 years ago
You'll have to show us your code. We don't know what you mean by "given folder", "any folder", "that folder", etc. What function are you using to rename? You cannot rename a file and have it show up in a different folder; you have to use 'move' for that.