Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: What specifically is the "file position"?

by beable (Friar)
on Jul 24, 2004 at 03:00 UTC ( [id://377065]=note: print w/replies, xml ) Need Help??


in reply to What specifically is the "file position"?

You could try asking the computer:
#!/usr/bin/perl use strict; use warnings; use Fcntl 'SEEK_END'; my $filename = "testfile"; create_file(); seek_file(); sub create_file { my $size = 4096; open OUTFILE, ">$filename" or die "can't open $filename: $!"; print OUTFILE "x" x $size or die "can't print to $filename: $!"; close OUTFILE or die "can't close $filename: $!"; } sub seek_file { open INFILE, "<$filename" or die "can't open $filename: $!"; my $result = sysseek INFILE, 0, SEEK_END; close INFILE; print "sysseek() returned $result\n"; } __END__ Output: sysseek() returned 4096

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://377065]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-18 14:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found