|Perl Monk, Perl Meditation|
How to prefix a string to all the files in a directories as well subdirectoriesby perladdict (Chaplain)
|on Dec 29, 2008 at 10:44 UTC||Need Help??|
perladdict has asked for the
wisdom of the Perl Monks concerning the following question:
I am trying to prefix a string (reference_)to all the *.bmp files in all the directories as well sub directories. At first time when we run silk script it will creates directries as well subdirectries,under each subdirectories it will stores each mobile application's sceenshot with .bmp extension.
.when i run the automated silkscript for second time it will again creates *.bmp files in all the subdirectories.Before running the script for second time i want to prefix all the *.bmp with a string reference_.
For Example first_screen.bmp to reference_first_screen.bmp
I have the directory structure as below
Image C:\Image_Repository\BG_Images\second and C:\Image_Repository\BG_Images\sixth having first_screen.bmp and first_screen.bmp files etc...,could any one help me out how can i prefix all the imagefiles with "reference_" string
.When i run the script for second time perl script in silk will take both the images from the subdirectory and compairs the both pixel by pixel.I am trying with below code, could u please guide me how can i proceed to complete this task.
I tried open call with '+<' mode but i am getting compilation error for the read and write mode.
When i am running this code it shows the files in BG_images folder with prefixed string but actully its not updating files in the subdirectories.