in reply to Re^2: Perl won't Open() when called from Java
in thread Perl won't Open() when called from Java

Oh I see. STDERR is unbuffered, but STDOUT buffers. Thanks!
  • Comment on Re^3: Perl won't Open() when called from Java

Replies are listed 'Best First'.
Re^4: Perl won't Open() when called from Java
by Marshall (Canon) on Feb 23, 2012 at 19:56 UTC
    Yes, that's right. A typical value for the buffer would be 4K. Mileage varies of course! But it it is completely conceivable that since the program is "hung" that there are unprinted things in the buffer.
      It was a hardcoded 4K until recently (5.14?). IIRC, now it's configurable at build time, with a default of 8K
        Fair enough.

        For most 32 bit file systems, 4K is the smallest "hunk of disk space" that can be allocated => 8 * 512 byte sectors on the disk. For a variety of reasons, 512 bytes has worked out to be the standard way that disks are formatted at a very low level.

        On larger file systems, it could very well be that 8K is the minimum file system "block". In that case, I would expect a file system performance increase if the Perl idea of a "block" corresponded to the file system's idea (the minimum size of thing that it will write to the disk). There are of course huge differences between O/S versions and even file systems on the same O/S.

        Powers of 2 are "magic", the file system will deal with either 4 or 8 KBytes, not 6! So 4 or 8 KB are plausible numbers.