in reply to Re^6: Error binmode() on unopened filehandle
in thread Error binmode() on unopened filehandle
There are a lot of scenarios where you might want to read the first part of a file without reading the whole file. I think there are some Unix file commands that read the first 1-2K of a file to determine if the file is text or binary? Perhaps I want to concatenate some big .WAV files together. There is some header info at the beginning of these files that needs to be interpreted. In the OP's question, this is a single .jpg and there is no reason to read the file in "hunks" because the image has to be processed as a single unit. However, other scenarios do exist.
I do commend you for the choice of 8*1024 as buf size. That is a very good number with most file systems. Certain byte boundaries are important for the file system to work efficiently.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Error binmode() on unopened filehandle
by ikegami (Patriarch) on May 07, 2020 at 18:57 UTC | |
by Marshall (Canon) on May 08, 2020 at 22:22 UTC | |
by ikegami (Patriarch) on May 09, 2020 at 08:27 UTC | |
by Marshall (Canon) on May 10, 2020 at 23:29 UTC |