Steve wrote:
This code is much improved...
The point wasn't to do what sed does, only a little faster, because the approach is all wrong. The point is to find a solution that can remove the first few lines of a huge file without copying the whole rest of the file. In CS speak, we're talking constant vs. linear. In my view, the best solution would involve a file system hack as has already been proposed. The fuse and loopback options seem most promising.
In other words, you could optimize this C++ code all day long, and it won't make any significant difference because you're still bound by the linear operation of copying most of the file.
--Dave /* PLUG: http://plug.org, #utah on irc.freenode.net Unsubscribe: http://plug.org/mailman/options/plug Don't fear the penguin. */
