|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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> |
|
#2
|
|||
|
|||
|
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/<> |
|
#3
|
|||
|
|||
|
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/<> |
![]() |
| Viewing: Web Development Archives > Mailing Lists > Perl > mkdir? system? split? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|