I can't figure out whats wrong with my move file, it seems to want to start in the root of c and I cannot seem to make it not start there. so I was going to try using file:find,
I came up with this but of course it doesn't work because perl absolutely hates me and I am still a perltard. this dies with an invalid top directory in line 593.
the current directory is not a top level directory though its in c:\inetpub\performancetesting\output\mlx which is where I want the file:find to start recursively moving files from and I want them put into a tree that is exactly the same below c:\\mlx so I am basically trying to move the whole directory tree to another location. please someone help me with either file my previous post I will add a link for on the next update.
@ARGV = qw(.) unless @ARGV;
use File::Find;
use File::Copy;
use Data::Dumper;
@dirs=();
my $dir="\\mlx\\";
find sub {move("$File::Find::name, -d","$dir.$_") or die "This didn't
+work either"};
my previous attempt which is now giving me an error due to the path.
//760926 not sure if this link will work. link does not work.
from the book I was reading I thought -d was directory,
example..
ok I fixed the problem with the move it was due to the directory I was calling it from, I was using a batch file, needed to do a chdir to the correct path apparently the script was looking at the current location, anyways I have it working now.
@ARGV = qw(.) unless @ARGV;
use File::Find;
find sub { print $File::Find::name, -d && "/", "\n" }, @ARGV;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.