open (DB, "+<test.db"); truncate (DB, 1024);
close DB; 1. This truncate the file from bottom .......... Is there a way the file can truncated from the top? 2. I have DB with 4-8 digits number in each line e.g. 1238483 92933 09983433 093 The truncate function truncates the file very abruptly .... for example the last line 093 after truncate will be left 0 . Is there a way that it should remove the last full line \n? rather leaving 1 or 2 digits behind. Thanks for any input, Sara.