Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > copy dir structure

Reply
Thread Tools

copy dir structure

 
 
frytaz@gmail.com
Guest
Posts: n/a
 
      12-25-2005
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

 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      12-25-2005
(E-Mail Removed) wrote:
> 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

 
Reply With Quote
 
 
 
 
frytaz@gmail.com
Guest
Posts: n/a
 
      12-25-2005
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

 
Reply With Quote
 
Paul Lalli
Guest
Posts: n/a
 
      12-25-2005

(E-Mail Removed) wrote:
> 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

 
Reply With Quote
 
frytaz@gmail.com
Guest
Posts: n/a
 
      12-25-2005
it would be great if somebody or maybe U will write it
if its possible please

 
Reply With Quote
 
Paul Lalli
Guest
Posts: n/a
 
      12-25-2005

http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> it would be great if somebody or maybe U will write it
> if its possible please


Sorry, wrong newsgroup. This newsgroup is to help people learn Perl
and debug their Perl programs.

http://jobs.perl.org is down the hall

Paul Lalli

 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      12-25-2005
(E-Mail Removed) <(E-Mail Removed)> wrote:

> 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!).


--
Tad McClellan SGML consulting
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dir() vs print(dir()) in the embedded mode Nick Gnedin Python 2 03-30-2013 05:52 AM
Re: dir() vs print(dir()) in the embedded mode MRAB Python 0 03-29-2013 09:24 PM
External prog get file from main dir, want file in diff dir Kga Agk Ruby 2 06-29-2009 02:09 PM
Behaviour of Dir.glob("**/b") and Dir.glob("*/b") for symlinks Matthew Denner Ruby 1 08-04-2006 03:42 PM
Sub Dir, Virtual dir, what do I use? =?Utf-8?B?UnVkeQ==?= ASP .Net 0 06-12-2005 08:25 PM



Advertisments