in reply to problems with truncate function

I gave a try with a simple file and it works fine.
You truncate to 0, means your file will be empty afterwards.
if size, 0 in your case, is greater than the files length then the behavior is undefined.
Means you got to have some content in your file. Do you have content in your file?
See: tuncate

Cheers!
Tobias

Replies are listed 'Best First'.
Re^2: problems with truncate function
by david2008 (Scribe) on Jun 26, 2013 at 09:18 UTC
    Hi,
    My file has content.
    BR,
    David