Syntax-K

Know-How für Ihr Projekt

Perl Documentation

NAME

File::Copy - Copy files or filehandles

SYNOPSIS

	use File::Copy;
	copy("sourcefile","destinationfile") or die "Copy failed: $!";
	copy("Copy.pm",\*STDOUT);
	move("/dev1/sourcefile","/dev2/destinationfile");
	use File::Copy "cp";
	$n = FileHandle->new("/a/file","r");
	cp($n,"x");

DESCRIPTION

The File::Copy module provides two basic functions, copy and move, which are useful for getting the contents of a file from one place to another.

RETURN

All functions return 1 on success, 0 on failure. $! will be set if an error was encountered.

NOTES

Before calling copy() or move() on a filehandle, the caller should close or flush() the file to avoid writes being lost. Note that this is the case even for move(), because it may actually copy the file, depending on the OS-specific inplementation, and the underlying filesystem(s).

AUTHOR

File::Copy was written by Aaron Sherman <ajs@ajs.com> in 1995, and updated by Charles Bailey <bailey@newman.upenn.edu> in 1996.