copy dir structure

Discussion in 'Perl Misc' started by frytaz@gmail.com, Dec 25, 2005.

  1. Guest

    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
     
    , Dec 25, 2005
    #1
    1. Advertising

  2. Paul Lalli Guest

    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
     
    Paul Lalli, Dec 25, 2005
    #2
    1. Advertising

  3. Guest

    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
     
    , Dec 25, 2005
    #3
  4. Paul Lalli Guest

    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
     
    Paul Lalli, Dec 25, 2005
    #4
  5. Guest

    it would be great if somebody or maybe U will write it
    if its possible please
     
    , Dec 25, 2005
    #5
  6. Paul Lalli Guest

    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
     
    Paul Lalli, Dec 25, 2005
    #6
  7. <> 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
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Dec 25, 2005
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UnVkeQ==?=

    Sub Dir, Virtual dir, what do I use?

    =?Utf-8?B?UnVkeQ==?=, Jun 12, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    443
    =?Utf-8?B?UnVkeQ==?=
    Jun 12, 2005
  2. Matthew Denner
    Replies:
    1
    Views:
    211
  3. Kga Agk
    Replies:
    2
    Views:
    160
    Kga Agk
    Jun 29, 2009
  4. Nick Gnedin
    Replies:
    2
    Views:
    174
  5. MRAB
    Replies:
    0
    Views:
    133
Loading...

Share This Page