in reply to Re^2: questions regarding "+<"
in thread questions regarding "+<"
Filesystems generally don't support an insert feature. "+<" gives you read/write access. It isn't a "prepend" or "insert" feature. Any changes made will write over what was there before, beginning at the current position within the file.
If you want to prepend something to a file, the standard idiom is to rename the input file, create a new file by the original name of the input file, start copying the old (newly renamed) input file over to the new file, while adding your "insert" text at the appropriate point, and follow that insertion with a copy of the remainder of the source file. Then unlink the original source file. That's essentially what the -i Perl command line switch does.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: questions regarding "+<"
by lightoverhead (Pilgrim) on May 15, 2014 at 20:14 UTC | |
by davido (Cardinal) on May 15, 2014 at 20:38 UTC |