Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> To know the offset of each line, you'll need to load the entire file from disk.

No. You will need to read the file, not load it all at once in memory. And for a sequential scan, you need very little memory at any one time.

And if you are doing that, you can start displaying the file as soon as you have scanned enough to fill the view. The rest could happen in the background.



I didn’t say you had to keep it all in memory to process the line ending. Of course you don’t. You need only two characters of memory (assuming you’re handling windows line breaks).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: