Hi,

The following program:

module Main(main) where
main:: IO()
main = do {
        xs <- mapM readFile (take 1000 (repeat "tmp"));
        return ();
}

Results in the error:

Fail: resource exhausted
Action: openFile
Reason: process file table full tmp



This doesn't work either:

myreadFile :: String -> IO String
myreadFile filename = do {
        f <- openFile filename ReadMode;
        x <- hGetContents f;
        hFlush f;
        hClose f;
        return x;
}

main:: IO()
main = do {
        xs <- mapM (\x -> let y = myreadFile x in seq y y)
                   (take 1000 (repeat "tmp"));
        return ();
}

Regards,
  Jan

P.S. My system:

(~ 270) uname -sr
SunOS 5.6
(~ 271) dmesg | grep SUNW
cpu0: SUNW,UltraSPARC-IIi (upaid 0 impl 0x12 ver 0x12 clock 270 MHz)
SUNW,m64B0 is /pci@1f,0/pci@1,1/SUNW,m64B@2
stdout is </pci@1f,0/pci@1,1/SUNW,m64B@2> major <35> minor <0>
SUNW,hme0: CheerIO 2.0 (Rev Id = c1) Found
SUNW,hme0 is /pci@1f,0/pci@1,1/network@1,1
SUNW,hme0: Using Internal Transceiver
SUNW,hme0: 100 Mbps full-duplex Link Up
(~ 272) cat /etc/release 
                  Solaris 2.6 5/98 s297s_hw3smccDesktop_09 SPARC
           Copyright 1998 Sun Microsystems, Inc.  All Rights Reserved.
                           Assembled on 24 April 1998
(~ 273) ghc --version
The Glorious Glasgow Haskell Compilation System, version 4.08
(~ 274) gcc --version
2.8.1
(~ 275) which make
make:    aliased to gmake
(~ 276) /home/kort/pkgs/make/bin/make --version
GNU Make version 3.78.1, by Richard Stallman and Roland McGrath.
Built for sparc-sun-solaris2.6
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
        Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to <[EMAIL PROTECTED]>.

(~ 277) man X | grep 'X Version' | grep '  1$'
Reformatting page.  Wait... done
X Version 11         Last change: Release 6                     1

Reply via email to