Not logged in
Log in now
Create an account
Subscribe to LWN
Pencil, Pencil, and Pencil
Dividing the Linux desktop
LWN.net Weekly Edition for June 13, 2013
A report from pgCon 2013
Little things that matter in language design
The 3.8 kernel is out
Posted Feb 19, 2013 16:24 UTC (Tue) by ssam (subscriber, #46587)
Posted Feb 19, 2013 17:15 UTC (Tue) by dkg (subscriber, #55359)
Posted Feb 19, 2013 18:26 UTC (Tue) by hummassa (subscriber, #307)
the one on the inode. for economy, the other one could even not be guaranteed to exist.
Posted Feb 19, 2013 21:38 UTC (Tue) by Aliasundercover (subscriber, #69009)
Few programs would get anything out of early access to the first few bytes of a longer file. Most programs dealing in text or small binary records use fread() or similar to make full block reads delivering convenient quantities without bothering the kernel repeatedly. fread() will read the whole first block and wait for it.
The kernel deals in whole pages making a valuable correspondence between mapped memory and file buffering. Space in a page past the end of a file can be all bytes zero. Space in a page which is unknown because it hasn't been read yet is complicated.
Posted Feb 20, 2013 8:25 UTC (Wed) by Otus (guest, #67685)
How about programs that need to find the file format and look for an initial magic number?
Posted Feb 20, 2013 13:20 UTC (Wed) by Wol (guest, #4433)
Posted Feb 20, 2013 14:37 UTC (Wed) by ssam (subscriber, #46587)
Also you may just be reading the first few bytes to know what icon to draw in your file browser.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds