Berkeley CSUA MOTD:Entry 11785
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/24 [General] UID:1000 Activity:popular
5/24    

2004/1/15-16 [Computer/SW/Languages/Perl] UID:11785 Activity:kinda low
1/14    I'm trying to flush output to disk after each write. This never writes
        to disk. What am i missing here (the file is being created):
        #!/usr/bin/perl
        $|=1;
        open(TEST,">test.txt") || die "Can't open: $!";
        print TEST "Testing\n";
        while(1) {}
        \_ call system's synch ?
           \_ $|=1 is supposed to flush after every print/write...
                \_ You forgot to call "select STDOUT" or "select TEST",
                   because $| bind to the last selected file descriptor.
                        \_ dear motd god, you're suppose to delete
                           useful replies. where are you?
                           \_ not even the censorbotidiot has the nerve to
                              kill this perfectly helpful response.