copy dir structure

F

frytaz

hi im a perl newbie

im trying to write script which will copy dir struture and create 0byte
files.
it looks like script scan dir and eq
/dir/files/jpg/first/ will be copied to /copy/first/

/dir/files/jpg/first/one.jpg 0.5mb -> /copy/first/one.jpg 0byte file
/dir/files/jpg/first/two.jpg 0.5mb -> /copy/first/two.jpg 0byte file
/dir/files/jpg/first/three.jpg 0.5mb -> /copy/first/three.jpg 0byte
file
/dir/files/jpg/first/ - > /copy/first/3-files-1.5mb-size 0byte file
/dir/files2/mp3/something/file.xxx 1mb -> /copy/something/file.xxx
0byte file
/dir/files2/mp3/something/ -> /copy/something/1-file-1mb-size 0byte
file

and only folders with files in them will be copied

please help me
 
P

Paul Lalli

hi im a perl newbie

Nothing wrong with that. Allow me to suggest some good resources for
newbies:

http://learn.perl.org
http://perldoc.perl.org
Run these from the command line:
perldoc perlintro
perldoc perl
perldoc perlfaq
im trying to write script which will copy dir struture and create 0byte
files.

Okay, what have you tried so far?
it looks like script scan dir and eq

I don't know what "and eq" is supposed to mean there.
/dir/files/jpg/first/ will be copied to /copy/first/

/dir/files/jpg/first/one.jpg 0.5mb -> /copy/first/one.jpg 0byte file
/dir/files/jpg/first/two.jpg 0.5mb -> /copy/first/two.jpg 0byte file
/dir/files/jpg/first/three.jpg 0.5mb -> /copy/first/three.jpg 0byte
file
/dir/files/jpg/first/ - > /copy/first/3-files-1.5mb-size 0byte file
/dir/files2/mp3/something/file.xxx 1mb -> /copy/something/file.xxx
0byte file
/dir/files2/mp3/something/ -> /copy/something/1-file-1mb-size 0byte
file

and only folders with files in them will be copied

please help me

I would suggest using the File::Find (included in your Perl
distribution) and File::Touch (available from http://search.cpan.org)
modules.

If you post the code you've attempted thus far, it's likely someone
here can help you fix it.

This would also be a good time for you to read the "Posting Guidelines"
for this group, which are posted here twice a week and can be found by
a simple Google search.

Paul Lalli
 
F

frytaz

hmm im dont have perl installed on my hdd im trying to run it at shell
if not im perl it could be wrote in some diff lang
 
P

Paul Lalli

hmm im dont have perl installed on my hdd im trying to run it at shell
if not im perl it could be wrote in some diff lang

I'm confused as to what your point is. If you have Perl installed in
whatever environment your shell is in, you still have access to perl,
perldoc, the web, File::Find, and you can still install File::Touch
(see perldoc -q library)

Or were you just expecting someone here to write it for you?

Paul Lalli
 
T

Tad McClellan

it would be great if somebody or maybe U will write it
if its possible please


You will get better responses to your job offer if you include
how much the job pays.

We _help_ people write programs, we don't generally write
whole programs to specification.

Try it yourself. Ask specific questions here when you get stuck (show code!).
 

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

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top