From: SourceForge.net <no...@so...> - 2005-10-28 13:51:59
|
Bugs item #1340708, was opened at 2005-10-28 15:46 Message generated for change (Settings changed) made by vasiljevic You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=719006&aid=1340708&group_id=130646 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: C-API Group: Current >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Bernd Eidenschink (eide) Assigned to: Nobody/Anonymous (nobody) Summary: ns_ftruncate broken? Initial Comment: Example: <file> = File with 100 chars Test 1: set f [open <file> w] ns_ftruncate $f 200 close $f File size = 200 bytes completely with "0" bytes. Test 2: set f [open <file> w] ns_ftruncate $f 50 close $f File size = 50 bytes completely with "0" bytes. ns_truncate works as expected when appending or truncating. Or do I just expect the wrong thing from ns_ftruncate? ---------------------------------------------------------------------- >Comment By: Zoran Vasiljevic (vasiljevic) Date: 2005-10-28 15:51 Message: Logged In: YES user_id=95086 You are opening with "w" which truncates the file initially. If you wanted to open existing file for writing, without zeroing the file you need to: open file a+ open file w+ or similar. See "man n open" for more info. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=719006&aid=1340708&group_id=130646 |