Directory structure question

B

Bryan

Hi,

I have a directory structure like this:

/data/exp/file1/file1.xml
/data/exp/file2/file2.xml
/data/exp/file3/file3.xml
/data/file1/file1.xml
/data/cust/exp/file1/file1.xml

I need to read in the xml files, do some processing on them, and then
output them to an identical directory structure, but with a different
root name, like this:

/data_out/exp/file1/file1.xml
/data_out/exp/file2/file2.xml
/data_out/exp/file3/file3.xml
/data_out/file1/file1.xml
/data_out/cust/exp/file1/file1.xml

If the folders at each level do not exist, I would need to create them
(assuming the xml processing passes some validation check). So if one
file fails, it would just skip the creation of that directory.

What is the best way to read in the directory tree, and then recreate it?

Thanks,
B
 
U

usenet

I need to read in the xml files, do some processing on them, and then
output them to an identical directory structure, but with a different
root name

Try the dircopy() method of File::Copy::Recursive, which will clone
the directory structure.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top