in reply to Wht is my .txt file full of garbage? And why does this flock cause a compilation error?
As for the garbage in the file.. there's one thing that I see that could be causing it. When you read in the data, where's the file pointer? You then truncate the file. I'm not positive, but I think your pointer is beyond the end of the file.
Before you truncate it, do a
I did a quick test and without the seek, I couldn't see anything in the file. When I used seek, everything printed fine.seek FH, 0, 0;
Hope this helps..
Rich
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Wht is my .txt file full of garbage? And why does this flock cause a compilation error?
by jerrygarciuh (Curate) on Nov 14, 2001 at 07:25 UTC |