This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g77 file truncation bug
- To: mike at snl951 dot chem dot metro-u dot ac dot jp
- Subject: Re: g77 file truncation bug
- From: Toon Moene <toon at moene dot indiv dot nluug dot nl>
- Date: Wed, 28 Feb 2001 20:29:22 +0100
- CC: gcc-bugs at gcc dot gnu dot org, Brett Bode <brett at si dot fi dot ameslab dot gov>
- Organization: Moene Computational Physics, Maartensdijk, The Netherlands
- References: <200102192255.HAA15160@snl951.chem.metro-u.ac.jp>
mike@snl951.chem.metro-u.ac.jp wrote:
> The problem is that when a disk file is overwritten, and its new
> length is shorter than its previous length, the shorter length file
> is truncated in a peculiar way. It seems the file is copied into
> the /tmp partition, reopened so it has zero length, and then the
> data is copied back into the file from /tmp. This is not only very
> inefficient, it is sure to fail whenever the file is bigger than
> the free space in /tmp. Since our disk files routinely exceed 1 GB,
> this is very often. The fix for the problem is to use the system
> call ftruncate() instead of this double copying.
Again - thanks for your detailed bug report. We have been able to
repair this shortcoming in the run time library of g77.
The upcoming release of the GNU Compiler Collection (version number
3.0), which is planned to be available in about a month's time, will
contain this fix.
Kind regards,
--
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)