Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Is it possible at all to flush buffer and commit file write, if UTF-8 encoding is being used??

by ikegami (Patriarch)
on Oct 13, 2023 at 18:51 UTC ( [id://11154945]=note: print w/replies, xml ) Need Help??


in reply to Is it possible at all to flush buffer and commit file write, if UTF-8 encoding is being used??

my $oldfh = select $logf; $| = 1; select($oldfh); *does* flush Perl's buffer.

$logf->autoflush(1); *does* flush Perl's buffer.

$logf->flush(); *does* flush Perl's buffer.

close $logf; *does* flush Perl's buffer.

It doesn't necessary flush the OS's buffers. (You'll need to ask the OS to do that.) But the data will appear in the file to other processes.

  • Comment on Re: Is it possible at all to flush buffer and commit file write, if UTF-8 encoding is being used??
  • Select or Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-15 00:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found