P is for Practical | |
PerlMonks |
Re^6: Remove Script for a Infrastructure file managenet system running embedded perlby sanju7 (Acolyte) |
on Jul 21, 2010 at 21:11 UTC ( [id://850727]=note: print w/replies, xml ) | Need Help?? |
Roboticus: Your leads were genuine so i made few changes in the code .
Here activated the no_chdir flag of File::Find. Now i get the full file path. Also i tested with the shared path as well (//homename/share-dir/)type paths. Based on the observation i have applied a variable input modification to convert every shared path to (////hostname//share-dir//) type. Because given proper escape to the backslashes the code is able to stat the share paths. These are all good. New Issue Since last 3 days of testing shows the code is behaving differently in Windows and Linux depending upon where the agent is running them.The above code does work fine when agent run them on, (a) windows when the path are local (C:\dir\source)type path and cleans up the directories when the source directories are empty etc.(b) But it still fails silently when agent runs them from Windows to (\\hostname\share-dir\) type paths. (c) Also when agent is running in Linux its failing silently to remove (/usr/local/share-dir/) type paths. A small check on all of these test conditions does detect that when code iterates through empty directory it goes through check1/3 (prints check1 and check3) i.e if operator does compare properly and brings it to the right loop, however it still doesn't do the cleaning.<\P> Is it possible when the code iterates through empty directory and the $file becomes empty or (undef or 0) confusing the if operator and not running the rest of command on that curly brace properly ? In that case i have to test the $file variable on each time for undef or no value and null it or something i guess. What do you think ?
In Section
Seekers of Perl Wisdom
|
|