From: Jarkko Hietaniemi Date: Mon, 19 Nov 2001 20:22:36 +0000 (+0000) Subject: sysseek tweak. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=86989e5ddfebcf92232ac079b053bdae48a24c3d;p=p5sagit%2Fp5-mst-13.2.git sysseek tweak. p4raw-id: //depot/perl@13107 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 679fe37..3feb50d 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -5244,10 +5244,15 @@ C, C, C, C, or C may cause confusion. FILEHANDLE may be an expression whose value gives the name of the filehandle. The values for WHENCE are C<0> to set the new position to POSITION, C<1> to set the it to the current position plus POSITION, -and C<2> to set it to EOF plus POSITION (typically negative). For -WHENCE, you may also use the constants C, C, and -C (start of the file, current position, end of the file) -from the Fcntl module. +and C<2> to set it to EOF plus POSITION (typically negative). + +For WHENCE, you may also use the constants C, C, +and C (start of the file, current position, end of the file) +from the Fcntl module. Use of the constants is also more portable +than relying on 0, 1, and 2. For example to define a "systell" function: + + use Fnctl 'SEEK_CUR'; + sub systell { sysseek($_[0], 0, SEEK_CUR) } Returns the new position, or the undefined value on failure. A position of zero is returned as the string C<"0 but true">; thus C returns