FAQ
Hi all
I am runnibg PERL programs on a linux box.
Is there a straight way to copy one file on the system to a different
location, other that opening one file and writing it to another?
Thank you
Aman

_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com

Search Discussions

  • Venkata rama sasank at Apr 4, 2002 at 8:14 pm
    hi aman,

    i dunno how far it would work

    but why dont u invoke system commands like "system". i know that
    this works C but i have never tried it in PERL.

    system (" cp source_file destination"); works fine in C.

    sasank

    --
    reading these signatures is really boring ......
    so i decided against having a signature
    ---- P.V.Rama Sasank
  • John Lenton at Apr 4, 2002 at 8:24 pm

    On Thu, Apr 04, 2002 at 01:25:35PM -0600, Aman Raheja wrote:
    I am runnibg PERL programs on a linux box.
    Is there a straight way to copy one file on the system to a different
    location, other that opening one file and writing it to another?
    on all unixoid boxes you could use

    system('/bin/cp', $from, $to) == 0
    or die "$from -> $to: $?";

    whether this is "straight" (too many plays on words to choose
    one) is up to the reader.

    --
    John Lenton (john@grulic.org.ar) -- Random fortune:
    HD cerrado por vacaciones. Ponerse en contacto con A:
  • William R Ward at Apr 4, 2002 at 11:48 pm

    Aman Raheja writes:
    Hi all
    I am runnibg PERL programs on a linux box.
    Is there a straight way to copy one file on the system to a different
    location, other that opening one file and writing it to another?
    Thank you
    Aman
    use File::Copy;

    copy $origfile => $destfile or die "Can't copy: $!\n";

    --Bill.

    --
    William R Ward bill@wards.net http://www.wards.net/~bill/
    -----------------------------------------------------------------------------
    If you're not part of the solution, you're part of the precipitate.
  • Sharan at May 6, 2002 at 8:10 am
    Try also File::NCopy to copy multiple files or directories.

    - Sharan Hiremath


    "Aman Raheja" <amancgiperl@hotmail.com> wrote in message
    news:F188R6IHupeyyfIIhs60000782b@hotmail.com...
    Hi all
    I am runnibg PERL programs on a linux box.
    Is there a straight way to copy one file on the system to a different
    location, other that opening one file and writing it to another?
    Thank you
    Aman

    _________________________________________________________________
    Join the world's largest e-mail service with MSN Hotmail.
    http://www.hotmail.com

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupscripts @
categoriesperl
postedApr 4, '02 at 7:26p
activeMay 6, '02 at 8:10a
posts5
users5
websiteperl.org

People

Translate

site design / logo © 2021 Grokbase