This is an archived low-energy page for bots and other anonmyous visitors.
Please sign up if you are a human and want to interact.
in reply to Why, what, where to unpack?! (was: Files, unpack and text values) in thread Files, unpack and text values
Answers to questions:
- If you don't know what to expect in return, unpack's not the right function for the job.
- No. A file (whether binary or text) is just a stream of bytes. Text files are said to be stored line-by-line because, in certain places, they have specific characters. $/ is also known as the Input Record Separator because it contains that special character -- usually a newline. The I/O routines read a chunk of bytes from a file and split it up based on the presence of whatever's in $/. That happens to default to \n. In a binary file, there are no lines.
- It's a nice power of two, and it fits nicely across the screen. No real technical reason of which I'm aware.
- Nope.
- Low-level I/O handling routine documentation, probably.
|