Если файлы ооочень большие, то чтением всего файла построчно в память и записью в новый файл не справиться!
Используйте модуль mmap.
а зачем оно так делает? чего ради заталкивать строчку в стек?
An object whose identifier is declared with no linkage and without the storage-class
specifier static has automatic storage duration.
For such an object that does not have a variable length array type, its lifetime extends
from entry into the block with which it is associated until execution of that block ends in
any way. (Entering an enclosed block or calling a function suspends, but does not end,
execution of the current block.) If the block is entered recursively, a new instance of the
object is created each time. The initial value of the object is indeterminate. If an
initialization is specified for the object, it is performed each time the declaration is
reached in the execution of the block; otherwise, the value becomes indeterminate each
time the declaration is reached.
const is specified in such a way that an implementation is at liberty to put const objects in
read-only storage, and is encouraged to diagnose obvious attempts to modify them, but is not
required to track down all the subtle ways that such checking can be subverted.
Мне бы хотелось понять причины этого
nohibernate
.