Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please Help 1

Status
Not open for further replies.

sriramus

Technical User
Nov 11, 2005
8
GB
Hello All,

i want to write a perl script which processess the Build folder and i select few folders with in the build folder and work on them and then i exit or close the program.
after 5 minutes i run the same script and now my script should only work on the new folders that were included in
the build folder and ignore all the previously processed folders

Can anyone please give me the logic of doing this.
Any suggestion or help is highly appreciated.

Thanks in Advance.

 
You'll need some data structure to maintain your status
Code:
File Folder Name | Date/Time Updated  |updated by script
-----------------+--------------------+-----------------
            |

And then cycle through your directory tree looking for files/folders which have a later date/time, or aren't marked as processed by the script.

Should be enough to getyou started ..
HTH
--Paul


Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Hi Paul,

Many thanks for your valuable time spent to reply me, can you please give me some example code for me to understand even better or any other kind of help with scripting.

Once again Thanks a lot.
Hope to see a reply from you soon.

Thanks in advance
 
sriramus, we don't just hand out code, you have to demonstrate some effort on your part.

Have a look at File::Find, opendir, readdir, closedir, stat (this will give you a lot of information wrt to dates, sizes etc) and what processing do you want to do on the files?

--Paul

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Paul,

Thanks again, can u give some guidelines as to how do i find out if my script opened the folder when it ran last time. i opened a tutorial on perl data strecture but dint feel if it will give me a solution, i am sure i am understanding things wrong so you further help me.

Thanks in advance

 

One way of doing this would be to save/append the names of the folders that have already been processed in a txt file and use that txt file everytime you run the program to get a list of files that have already been processed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top