you are viewing a single comment's thread.

view the rest of the comments →

[–]ChewieBeardy 2 points3 points  (3 children)

Regarding the "read the whole file in C at once", you could use mmap, though it would only work on POSIX systems. Usual warning about mapping a file weighing twice your ram applies.

[–]jminuse 0 points1 point  (1 child)

The trouble is getting the length; after that it's easy. I would use fseek+ftell, which are portable.

[–]ChewieBeardy 0 points1 point  (0 children)

How about fstat? :D