See what Microsoft has to say about IO size: http://technet.microsoft.com/en-us/library/cc938632.aspx. Basically, they say you should probably do IO in 64K blocks.
On *NIX platforms, struct stat has a st_blksize member which says what should be a minimal IO block size.
proposal
in os.nim:
os.rawToFormalFileInfo
to also expose blockSize computed fromStat.st_blksize
blockSize
so users don't have to guess thisexample
on my system (OSX), prints: (4096,) which shows
8192
may not be the optimal.On other systems it could be larger than 8192, which would incur large overhead (see https://stackoverflow.com/a/237495/1426932) for applications if they used 8192.
(note, block size can also vary per file, but this might be rare though)
links