Perl Home
PERL Functions
© 2013 TutorialsPoint.COM
|
PERL telldir Function
Advertisements
Syntax
|
truncate FILEHANDLE, LENGTH
|
Definition and Usage
Truncates (reduces) the size of the file specified by FILEHANDLE to the specified LENGTH (in bytes). Produces a fatal error if the function is not implemented on your system.
Return Value
Example
Following example will truncate file "test.txt" to zero length.
#!/usr/bin/perl -w
open( FILE, "</tmp/test.txt" ) || die "Enable to open test file";
truncate( FILE, 0 );
close(FILE);
|
|
Advertisements
|
|
|