3 ms·
Seeking to a file offset is a constant-time operation (assuming no fragmentation), so re-opening the file and skipping to where you left off isn't that bad. An
by ygra 7y ago
Seeking to a file offset is a constant-time operation (assuming no fragmentation), so re-opening the file and skipping to where you left off isn't that bad.
And you can certainly write self-modifying batch files, but only appending at the end is safe, not changing lines before you're currently executing.
- vortico 7y ago>re-opening the file and skipping to where you left off That's what Windows does now. But I think in the past it wasn't that way (as suggested by the sources). In my tests it appears that the command processor caches the byte offsets of each line, so it's possible to GOTO any line in the past without rescanning the whole file.