summaryrefslogtreecommitdiff
path: root/ghc/lib/std/Directory.lhs
Commit message (Collapse)AuthorAgeFilesLines
* [project @ 2002-02-12 15:17:13 by simonmar]simonmar2002-02-121-568/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch over to the new hierarchical libraries --------------------------------------------- This commit reorganises our libraries to use the new hierarchical module namespace extension. The basic story is this: - fptools/libraries contains the new hierarchical libraries. Everything in here is "clean", i.e. most deprecated stuff has been removed. - fptools/libraries/base is the new base package (replacing "std") and contains roughly what was previously in std, lang, and concurrent, minus deprecated stuff. Things that are *not allowed* in libraries/base include: Addr, ForeignObj, ByteArray, MutableByteArray, _casm_, _ccall_, ``'', PrimIO For ByteArrays and MutableByteArrays we use UArray and STUArray/IOUArray respectively now. Modules previously called PrelFoo are now under fptools/libraries/GHC. eg. PrelBase is now GHC.Base. - fptools/libraries/haskell98 provides the Haskell 98 std. libraries (Char, IO, Numeric etc.) as a package. This package is enabled by default. - fptools/libraries/network is a rearranged version of the existing net package (the old package net is still available; see below). - Other packages will migrate to fptools/libraries in due course. NB. you need to checkout fptools/libraries as well as fptools/hslibs now. The nightly build scripts will need to be tweaked. - fptools/hslibs still contains (almost) the same stuff as before. Where libraries have moved into the new hierarchy, the hslibs version contains a "stub" that just re-exports the new version. The idea is that code will gradually migrate from fptools/hslibs into fptools/libraries as it gets cleaned up, and in a version or two we can remove the old packages altogether. - I've taken the opportunity to make some changes to the build system, ripping out the old hslibs Makefile stuff from mk/target.mk; the new package building Makefile code is in mk/package.mk (auto-included from mk/target.mk). The main improvement is that packages now register themselves at make boot time using ghc-pkg, and the monolithic package.conf in ghc/driver is gone. I've updated the standard packages but haven't tested win32, graphics, xlib, object-io, or OpenGL yet. The Makefiles in these packages may need some further tweaks, and they'll need pkg.conf.in files added. - Unfortunately all this rearrangement meant I had to bump the interface-file version and create a bunch of .hi-boot-6 files :-(
* [project @ 2002-01-07 15:29:56 by sof]sof2002-01-071-4/+7
| | | | | Ho-hum, readdir() and readdir_r() with GNU libc doesn't flag the end of the directory stream the same way. Cope.
* [project @ 2002-01-04 10:56:09 by sof]sof2002-01-041-10/+15
| | | | | getDirectoryContents: use the re-entrant readdir_r() to get at directory entries, if available.
* [project @ 2001-12-27 11:29:58 by sof]sof2001-12-271-6/+1
| | | | | | | | | | Get rid of uses of #const, #peek, #poke and #ptr from PrelPosix.hsc (this leaves just uses of #type in PrelPosix) - provide constant and accessor wrappers via PrelIOUtils.c instead. Who knows, we might just be able to bootstrap via .hc files again..? Only compiled & tested under Win32.
* [project @ 2001-11-07 07:56:57 by sof]sof2001-11-071-0/+565
| | | | Directory impl which interacts with OS plat via C wrappers
* [project @ 2001-01-11 17:25:56 by simonmar]simonmar2001-01-111-604/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-organisation of ghc/lib/std and hslibs/lang ---------------------------------------------- In brief: move deprecated features out of ghc/lib/std and into hslibs/lang, move new FFI libraries into ghc/lib/std and start using them. - foreign import may now return an unboxed type (this was advertised to work before, but in fact didn't). Subsequent cleanups in PrelInt/PrelWord. - Ptr is now defined in ghc/lib/std/PrelPtr.lhs. Ptr is no longer a newtype of Addr, it is defined directly in terms of Addr#. - PrelAddr has disappeared from ghc/lib/std, all uses of Addr in ghc/lib/std have been replaced with Ptr. The definitions of Addr has been moved to hslibs/lang/Addr.lhs, as has lots of other Addr-related stuff. - ForeignObj has been removed from ghc/lib/std, and replaced with ForeignPtr. The definition of ForeignObj has been moved to hslibs/lang/ForeignObj.lhs. - Most of the new FFI has been moved into ghc/lib/std in the form of modules PrelMarshalAlloc, PrelCString, PrelCError, PrelMarshalError, PrelMarshalArray, PrelMarshalUtils, PrelCTypes, PrelCTypesISO, and PrelStorable. The corresponding modules in hslibs/lang simply re-export the contents of these modules. - PrelPosixTypes defines a few POSIX types (CMode == mode_t, etc.) - PrelCError changed to access errno using foreign label and peek (the POSIX book I have says that errno is guaranteed to be an extern int, so this should be OK until I get around to making errno thread-safe). - Hacked the macros that generate the code for CTypes and CTypesISO to generate much less code (ghc/lib/std/cbits/CTypes.h). - RtsAPI is now a bit more honest when it comes to building heap objects (it uses the correct constructors). - the Bits class and related stuff has been moved to ghc/lib/std (it was simpler this way). - Directory and System have been converted to use the new FFI.
* [project @ 2001-01-11 07:04:16 by qrczak]qrczak2001-01-111-3/+5
| | | | Change the representation of IOException: add optional filename.
* [project @ 2000-08-24 10:27:01 by simonmar]simonmar2000-08-241-10/+18
| | | | | | | Change implementation of Directory.getPermissions to use access(2) rather than stat(2). This is rather more sensible as the permissions returned will be relevant to the current user rather than the owner of the file.
* [project @ 2000-07-07 11:03:57 by simonmar]simonmar2000-07-071-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rearrange exception stuff, as per my message on glasgow-haskell-users recently. The main change is the IOError type is now a synonym for Exception. IO.ioError can therefore be used for throwing exceptions. IO.catch still catches only IO exceptions, for backwards compatibility. The interface exported by Exception has changed somewhat: try :: IO a -> IO (Either Exception a) tryJust :: (Exception -> Maybe b) -> a -> IO (Either b a) catch :: IO a -> (Exception -> IO a) -> IO a catchJust :: (Exception -> Maybe b) -> IO a -> (b -> IO a) -> IO a ioErrors :: Exception -> Maybe IOError arithExceptions :: Exception -> Maybe ArithException errorCalls :: Exception -> Maybe String dynExceptions :: Exception -> Maybe Dynamic assertions :: Exception -> Maybe String asyncExceptions :: Exception -> Maybe AsyncException raiseInThread is now called throwTo. Where possible, the old functions have been left around, but marked deprecated.
* [project @ 2000-04-06 17:50:58 by rrt]rrt2000-04-061-1/+1
| | | | Fixed a tyop.
* [project @ 2000-03-28 08:52:28 by simonmar]simonmar2000-03-281-3/+2
| | | | | Replace freeze{Char,Int,Word,Float,Double}Array with freezeByteArray (using sizeofByteArray and a foreign import of C's memcpy()).
* [project @ 2000-03-23 17:46:59 by simonpj]simonpj2000-03-231-23/+23
| | | | Remove the .so suffixes in the foreign imports
* [project @ 2000-01-25 10:06:31 by panne]panne2000-01-251-4/+3
| | | | | Added intToWord to PrelAddr. Use it instead of int2Word#-hacks.
* [project @ 1999-12-20 10:34:27 by simonpj]simonpj1999-12-201-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit implements a substantial re-organisation of the Prelude It also fixes a couple of small renamer bugs that were reported recently (notably, Sven pointed out that we weren't reporting unused imports properly) My original goal was to get rid of all "orphan" modules (i.e. ones with instance decls that don't belong either to a tycon or a class defined in the same module). This should reduce the number of interface files that have to be read when compiling small Haskell modules. But like most expeditions into the Prelude Swamp, it spiraled out of control. The result is quite satisfactory, though. GONE AWAY: PrelCCall, PrelNumExtra NEW: PrelReal, PrelFloat, PrelByteArr, PrelNum.hi-boot (The extra PrelNum.hi-boot is because of a tiresome thin-air Id, addr2Integer, which used to be in PrelBase.) Quite a lot of types have moved from one module to another, which entails some changes to part of the compiler (PrelInfo, PrelMods) etc, and there are a few places in the RTS includes and even in the driver that know about these home modules (alas). So the rough structure is as follows, in (linearised) dependency order [this list now appears in PrelBase.lhs] PrelGHC Has no implementation. It defines built-in things, and by importing it you bring them into scope. The source file is PrelGHC.hi-boot, which is just copied to make PrelGHC.hi Classes: CCallable, CReturnable PrelBase Classes: Eq, Ord, Functor, Monad Types: list, (), Int, Bool, Ordering, Char, String PrelTup Types: tuples, plus instances for PrelBase classes PrelShow Class: Show, plus instances for PrelBase/PrelTup types PrelEnum Class: Enum, plus instances for PrelBase/PrelTup types PrelMaybe Type: Maybe, plus instances for PrelBase classes PrelNum Class: Num, plus instances for Int Type: Integer, plus instances for all classes so far (Eq, Ord, Num, Show) Integer is needed here because it is mentioned in the signature of 'fromInteger' in class Num PrelReal Classes: Real, Integral, Fractional, RealFrac plus instances for Int, Integer Types: Ratio, Rational plus intances for classes so far Rational is needed here because it is mentioned in the signature of 'toRational' in class Real Ix Classes: Ix, plus instances for Int, Bool, Char, Integer, Ordering, tuples PrelArr Types: Array, MutableArray, MutableVar Does *not* contain any ByteArray stuff (see PrelByteArr) Arrays are used by a function in PrelFloat PrelFloat Classes: Floating, RealFloat Types: Float, Double, plus instances of all classes so far This module contains everything to do with floating point. It is a big module (900 lines) With a bit of luck, many modules can be compiled without ever reading PrelFloat.hi PrelByteArr Types: ByteArray, MutableByteArray We want this one to be after PrelFloat, because it defines arrays of unboxed floats. Other Prelude modules are much easier with fewer complex dependencies.
* [project @ 1999-10-29 01:16:48 by andy]andy1999-10-291-1/+1
| | | | | | | Adding in the modified versions of the Standard Haskell 98 libraries. These should compile under both Hugs and GHC. use the flags -D__HUGS__ -DUSE_REPORT_PRELUDE to extract the Hugs src.
* [project @ 1999-02-17 15:57:20 by simonm]simonm1999-02-171-25/+3
| | | | | | | | | | | | | | | | | | Fast Integers. The rep. of Integers is now data Integer = S# Int# | J# Int# ByteArray# - several new primops added for overflow-detecting arithmetic - negateInteger# removed; it can be done directly - integer_0, integer_1 etc. removed. - the compiler now uses S# where it previously used int2Integer. - the compiler generates small integers for -2^32 .. 2^32-1, instead of -2^29 .. -2^29-1. - PrelST.State datatype moved to LazyST (its only use). - some library code (in Time.lhs) still needs cleaning up, it depends on the Integer rep.
* [project @ 1999-02-01 10:02:15 by sof]sof1999-02-011-1/+6
| | | | H98 Prelude tweaks
* [project @ 1999-01-15 17:22:02 by sof]sof1999-01-151-20/+21
| | | | Annotate the 'foreign import's with 'unsafe'.
* [project @ 1999-01-14 18:12:47 by sof]sof1999-01-141-210/+114
| | | | | | | Changes to make the Prelude comply with Haskell 98. I claim that this completes GHC's implementation of Haskell 98 (at least feature-wise, but there's bound to be some bugs lurking..)
* [project @ 1998-12-02 13:17:09 by simonm]simonm1998-12-021-16/+164
| | | | Move 4.01 onto the main trunk.
* [project @ 1998-08-14 12:59:24 by sof]sof1998-08-141-4/+4
| | | | Generate better IOErrors
* [project @ 1998-05-31 15:25:02 by sof]sof1998-05-311-1/+1
| | | | Bring prototypes of cbits/ stubs into scope when compiling .hc file
* [project @ 1998-05-22 15:57:05 by simonm]simonm1998-05-221-1/+0
| | | | | | - Add NOINLINE pragmas to the unsafe things (unsafe*IO, unsafe*ST, runST etc.) - Move unsafe function back into the proper modules - Remove PrelUnsafe*.lhs
* [project @ 1998-05-05 10:31:14 by sof]sof1998-05-051-7/+9
| | | | constructErrorAndFailWithInfo: new function for including files/paths that caused IO op to fail
* [project @ 1998-04-30 19:51:07 by sof]sof1998-04-301-6/+5
| | | | tidyup
* [project @ 1998-04-22 12:45:38 by sof]sof1998-04-221-18/+21
| | | | Simplified impl of getDirectoryContents
* [project @ 1998-02-02 17:27:26 by simonm]simonm1998-02-021-0/+548
Library re-organisation: All libraries now live under ghc/lib, which has the following structure: ghc/lib/std -- all prelude files (libHS.a) ghc/lib/std/cbits ghc/lib/exts -- standard Hugs/GHC extensions (libHSexts.a) -- available with '-fglasgow-exts' ghc/lib/posix -- POSIX library (libHSposix.a) ghc/lib/posix/cbits -- available with '-syslib posix' ghc/lib/misc -- used to be hslibs/ghc (libHSmisc.a) ghc/lib/misc/cbits -- available with '-syslib misc' ghc/lib/concurrent -- Concurrent libraries (libHSconc.a) -- available with '-concurrent' Also, several non-standard prelude modules had their names changed to begin with 'Prel' to reduce namespace pollution. Addr ==> PrelAddr (Addr interface available in 'exts') ArrBase ==> PrelArr CCall ==> PrelCCall (CCall interface available in 'exts') ConcBase ==> PrelConc GHCerr ==> PrelErr Foreign ==> PrelForeign (Foreign interface available in 'exts') GHC ==> PrelGHC IOHandle ==> PrelHandle IOBase ==> PrelIOBase GHCmain ==> PrelMain STBase ==> PrelST Unsafe ==> PrelUnsafe UnsafeST ==> PrelUnsafeST