logo       

[ ghc-Bugs-818932 ] Reading multiple files fails: msg#00018

lang.haskell.glasgow.bugs

Subject: [ ghc-Bugs-818932 ] Reading multiple files fails

Bugs item #818932, was opened at 2003-10-06 15:57
Message generated for change (Comment added) made by sigbjorn
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=818932&group_id=8032

Category: None
Group: 6.0.1
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Henk-Jan van Tuyl (hjvt)
Assigned to: Nobody/Anonymous (nobody)
Summary: Reading multiple files fails

Initial Comment:
The atttached zip file contains the file ReadALot.lhs,
which reads a series of files (these files are listed
in dir.dat). The program reads the first and the last
(non-empty) line of each file and writes them, together
with the filename in the output file result.dat.

The problem with the compiled program is, that the last
lines are not really the last lines of the files; they
are also not complete.

More info.:
This program is compiled under Windows 98, using the
enclosed compile.bat. The stdout messages from the
compiler can be found in compile.log; the stderr
messages can not be redirected under Windows 98.
All files needed for running the program are in the
attached file.


----------------------------------------------------------------------

>Comment By: Sigbjorn Finne (sigbjorn)
Date: 2003-10-07 08:44

Message:
Logged In: YES
user_id=232905

Thanks for a fine report.

The input files are being closed prematurely. Have a look at
semi-closed files in the Haskell Report.

To fix, either:

- drop the use of hClose
- define a custom forcing function that evaluates
the result of reading an input file before closing
it.


----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108032&aid=818932&group_id=8032


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise