Perl
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists Perl

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old April 19th, 2005, 04:52 PM
Bliss, Thomas W
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
mkdir? system? split?

Hello all, I am new to this list and appreciate all of your help.

I am trying to write a Windows perl script to move files from Windows
volume A to Windows volume B and keep the directory structure. I tried
to use mkdir but it will only create one directory deep.

I am reading a file that contains data like this:

\\server\share\dir1\dir2\\file1.txt

So far I have been successful in opening and reading the file. I also am
passing 3 arguments from the command line which I have captured into
variables (-s source of the data file above, -d destination volume where
is it to be moved to, and -l a log file in which we will capture what
files have been moved.)

Here is what I need yet:

1. I need to parse each line in the file for just the directory
structure (I assume split is what I want but I have not addressed this
yet) and get just the \dir1\dir2 so I can recreate it.
2. Create the directory structure on the new volume from the -d cmd line
arg
2a. If I use mkdir within perl then I need to parse the complete
directory list and then loop through each dir to create it on the -d
volume.
2b. I could call the DS MD and pass it the complete variable
structure of the combine -d + parsed dir from the file. I tried some
testing but could not seem to pass the system () any variable data.
3. Then I can use the move within perl to move the file with the
combined -s and -d+ new parsed dir\file from the file.

Any help on the above steps would be greatly appreciated. If you need to
see what I have I can send it out but it is not much right now. Thank
you in advance for your help.
Tom Bliss, Principal Consultant
Computer Associates TS, SNIA SCSE
Phone: 513-229-2366
e-mail: Thomas.Bliss (AT) ca (DOT) com <mailto:Thomas.Bliss (AT) ca (DOT) com>

Reply With Quote
  #2  
Old April 19th, 2005, 04:52 PM
JupiterHost.Net
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
mkdir? system? split?

Bliss, Thomas W wrote:
Hello all, I am new to this list and appreciate all of your help.

I am trying to write a Windows perl script to move files from Windows
volume A to Windows volume B and keep the directory structure. I tried
to use mkdir but it will only create one directory deep.

I'm not sure all those steps below are necessary. Have you looked at
File::Copy::Recursive
?

http://search.cpan.org/~

--
To unsubscribe, e-mail: beginners-unsubscribe (AT) perl (DOT) org
For additional commands, e-mail: beginners-help (AT) perl (DOT) org
<http://learn.perl.org/<>

Reply With Quote
  #3  
Old April 19th, 2005, 04:52 PM
Offer Kaye
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
mkdir? system? split?

4/19/05, JupiterHost.Net wrote:

I'm not sure all those steps below are necessary. Have you looked at
File::Copy::Recursive
?

http://search.cpan.org/~


There's also the "mkpath" function from File::Path, that can be used
to create a directory tree:


--
Kaye

--
To unsubscribe, e-mail: beginners-unsubscribe (AT) perl (DOT) org
For additional commands, e-mail: beginners-help (AT) perl (DOT) org
<http://learn.perl.org/<>

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists Perl > mkdir? system? split?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT