What are you working on? - Programming On Unix
Users browsing this thread: 53 Guest(s)
|
|||
(16-06-2015, 11:31 AM)greduan Wrote: Anyway it's hell, you guys in C have it easy. lol Actually, it's fairly complicated, as the "open()" system call only has 3 modes: read, write, append. read doesn't matter in this case, but the "write" mode will wipe the original file entirely, so you can write your text in it. so basically, removing an \n at the end of the file means rewriting the file entirely. No matter what. As for append mode, it keeps the original file intact, and you can only add bytes at the end, so not pretty useful for modifyin the initial content :P |
|||