haskell-directory.git
14 years agoWindows: Unicode getDirectoryContents and setPermissions
Simon Marlow [Thu, 18 Jun 2009 13:48:58 +0000 (13:48 +0000)]
Windows: Unicode getDirectoryContents and setPermissions

14 years agoadd a test for getDirectoryContents on a non-existent directory
Simon Marlow [Thu, 18 Jun 2009 10:29:00 +0000 (10:29 +0000)]
add a test for getDirectoryContents on a non-existent directory

14 years agoDecouple from System.Posix.Internals on Unix
Simon Marlow [Wed, 17 Jun 2009 15:38:52 +0000 (15:38 +0000)]
Decouple from System.Posix.Internals on Unix
This will let me clean up System.Posix.Internals, and move in the
direction of having System.Directory depend only on either
System.Posix or System.Win32.

14 years agochanges for the new IO library
Simon Marlow [Fri, 29 May 2009 13:22:05 +0000 (13:22 +0000)]
changes for the new IO library

14 years agoFix #3189: add docs to findExecutable
Simon Marlow [Fri, 29 May 2009 12:34:49 +0000 (12:34 +0000)]
Fix #3189: add docs to findExecutable

14 years agoFix #3189: use System.Win32.getFullPathName
Simon Marlow [Thu, 28 May 2009 13:57:06 +0000 (13:57 +0000)]
Fix #3189: use System.Win32.getFullPathName

14 years agoGive bounds for the dependencies; fixes #3141
Ian Lynagh [Sun, 24 May 2009 15:59:51 +0000 (15:59 +0000)]
Give bounds for the dependencies; fixes #3141

15 years agouse Nhc98BaseConfig.h rather than HsDirectoryConfig.h
Malcolm.Wallace@cs.york.ac.uk [Wed, 1 Apr 2009 10:59:53 +0000 (10:59 +0000)]
use Nhc98BaseConfig.h rather than HsDirectoryConfig.h

15 years agoSince __hscore_R_OK and friends are inline C, use correct .h location.
Malcolm.Wallace@cs.york.ac.uk [Mon, 16 Mar 2009 11:38:15 +0000 (11:38 +0000)]
Since __hscore_R_OK and friends are inline C, use correct .h location.
This patch just adds HsDirectory.h into the foreign imports of these
values.  Without it, nhc98 cannot generate correct interfacing code.

15 years agoStop the copyFile00{1,2} tests tripping over each other
Ian Lynagh [Fri, 13 Mar 2009 21:13:57 +0000 (21:13 +0000)]
Stop the copyFile00{1,2} tests tripping over each other

15 years agoFIX #3086: use System.Win32.getTemporaryDirectory
Simon Marlow [Thu, 12 Mar 2009 16:14:08 +0000 (16:14 +0000)]
FIX #3086: use System.Win32.getTemporaryDirectory

15 years agoFIX #2963: Use System.Win32.getCurrentDirectory
Simon Marlow [Wed, 11 Mar 2009 11:37:37 +0000 (11:37 +0000)]
FIX #2963: Use System.Win32.getCurrentDirectory

15 years agoAdd config.guess, config.sub and install-sh
Ian Lynagh [Sat, 7 Mar 2009 15:38:47 +0000 (15:38 +0000)]
Add config.guess, config.sub and install-sh

15 years agoFix Hugs build (#ifdef code inclusion was slightly wrong)
Malcolm.Wallace@cs.york.ac.uk [Wed, 18 Feb 2009 12:03:00 +0000 (12:03 +0000)]
Fix Hugs build (#ifdef code inclusion was slightly wrong)

15 years agonhc98 now uses more of the code (shared with ghc) here.
Malcolm.Wallace@cs.york.ac.uk [Fri, 6 Feb 2009 17:34:47 +0000 (17:34 +0000)]
nhc98 now uses more of the code (shared with ghc) here.

15 years agofix this test for the new version of createDirectoryIfMissing (#2808)
Simon Marlow [Wed, 4 Feb 2009 16:33:19 +0000 (16:33 +0000)]
fix this test for the new version of createDirectoryIfMissing (#2808)
- add another race test, for two threads both doing create;cleanup
- ignore isDoesNotExistErrors in create

15 years agoFix createDirectoryIfMissing to not throw if the dir got deleted
Duncan Coutts [Mon, 22 Dec 2008 16:41:05 +0000 (16:41 +0000)]
Fix createDirectoryIfMissing to not throw if the dir got deleted
When we call createDirectory and some file system object already exists
we have a problem. We need to distinguish if it is a file that already
exists or if it is a directory because in the latter case it is not an
error. Previously we called doesDirectoryExist however that does not
distinguish the dir not existing (due to another thread deleting it)
and an ordinary file existing. We now use withFileStatus to throw the
original AlreadyExistsError only if a non-directory object exists.
So now the only time we should get a spurious exception is if another
thread deletes the directory and puts a file in its place between our
call to createDirectory and withFileStatus. It should now be safe to
race createDirectoryIfMissing with itself or deleteDirectoryRecursive.

15 years agoAlternative implementation of createDirectoryIfMissing
Duncan Coutts [Thu, 18 Dec 2008 14:47:04 +0000 (14:47 +0000)]
Alternative implementation of createDirectoryIfMissing

15 years agoRequire Cabal version >= 1.6
Ian Lynagh [Thu, 22 Jan 2009 01:12:58 +0000 (01:12 +0000)]
Require Cabal version >= 1.6

15 years agoAdd "bug-reports" and "source-repository" info to the Cabal file
Ian Lynagh [Wed, 21 Jan 2009 18:21:23 +0000 (18:21 +0000)]
Add "bug-reports" and "source-repository" info to the Cabal file

15 years agoFix getPermissions001 on Windows
Ian Lynagh [Fri, 9 Jan 2009 18:25:54 +0000 (18:25 +0000)]
Fix getPermissions001 on Windows

15 years agoAvoid using IOError internals
Ian Lynagh [Sun, 4 Jan 2009 17:31:59 +0000 (17:31 +0000)]
Avoid using IOError internals

15 years agoadd Windows output
Simon Marlow [Mon, 1 Dec 2008 09:18:39 +0000 (09:18 +0000)]
add Windows output

15 years agorename test directory to avoid clash
Simon Marlow [Mon, 1 Dec 2008 09:22:54 +0000 (09:22 +0000)]
rename test directory to avoid clash

15 years agoavoid race conditions in createDirectoryIfMissing (#2808)
Simon Marlow [Wed, 26 Nov 2008 12:36:59 +0000 (12:36 +0000)]
avoid race conditions in createDirectoryIfMissing (#2808)

15 years agoadd test for createDirectoryIfMissing (#2808)
Simon Marlow [Wed, 26 Nov 2008 11:56:06 +0000 (11:56 +0000)]
add test for createDirectoryIfMissing (#2808)

15 years agoadd some extra_cleans
Simon Marlow [Fri, 14 Nov 2008 10:41:13 +0000 (10:41 +0000)]
add some extra_cleans

15 years agomake this test more robust to changes in the testsuite driver
Simon Marlow [Wed, 12 Nov 2008 12:21:18 +0000 (12:21 +0000)]
make this test more robust to changes in the testsuite driver

15 years agoFix these tests
Simon Marlow [Sat, 27 Sep 2008 13:31:11 +0000 (13:31 +0000)]
Fix these tests

15 years agoBump version number to 1.0.0.2
Ian Lynagh [Sat, 20 Sep 2008 16:00:29 +0000 (16:00 +0000)]
Bump version number to 1.0.0.2

15 years agofix typo in extra-source-files 6_10_branch_has_been_forked
Ross Paterson [Sun, 31 Aug 2008 14:39:21 +0000 (14:39 +0000)]
fix typo in extra-source-files

15 years agofix cabal build-depends for nhc98
Malcolm.Wallace@cs.york.ac.uk [Thu, 28 Aug 2008 10:47:33 +0000 (10:47 +0000)]
fix cabal build-depends for nhc98

15 years agoadd createDirectory (already exists) test
Simon Marlow [Tue, 26 Aug 2008 09:17:19 +0000 (09:17 +0000)]
add createDirectory (already exists) test

15 years agoadd extra-source-files
Ross Paterson [Sun, 24 Aug 2008 22:44:13 +0000 (22:44 +0000)]
add extra-source-files

15 years agoadd category field
Ross Paterson [Sun, 24 Aug 2008 00:30:13 +0000 (00:30 +0000)]
add category field

15 years agomake more use of System.Win32 or System.Posix
Simon Marlow [Thu, 21 Aug 2008 14:35:50 +0000 (14:35 +0000)]
make more use of System.Win32 or System.Posix

15 years agofix #2298: use MoveFileEx() on Windows
Simon Marlow [Wed, 20 Aug 2008 14:01:24 +0000 (14:01 +0000)]
fix #2298: use MoveFileEx() on Windows

15 years agotest for renameFile
Simon Marlow [Mon, 18 Aug 2008 15:50:59 +0000 (15:50 +0000)]
test for renameFile

15 years agoimport the Haskell 98 module Control.Exception.Base instead
Ross Paterson [Tue, 12 Aug 2008 23:45:53 +0000 (23:45 +0000)]
import the Haskell 98 module Control.Exception.Base instead

15 years agofixup for change of exception types in nhc98
Malcolm.Wallace@cs.york.ac.uk [Tue, 5 Aug 2008 15:52:53 +0000 (15:52 +0000)]
fixup for change of exception types in nhc98

15 years agoRemove uses of catchAny and ignoreExceptions
Ian Lynagh [Sun, 3 Aug 2008 11:41:20 +0000 (11:41 +0000)]
Remove uses of catchAny and ignoreExceptions

15 years agoFollow extensible exceptions changes
Ian Lynagh [Mon, 23 Jun 2008 19:31:05 +0000 (19:31 +0000)]
Follow extensible exceptions changes

15 years agoSilence warnings
Ian Lynagh [Thu, 3 Jul 2008 15:47:32 +0000 (15:47 +0000)]
Silence warnings

15 years agoFix warnings in directory
Ian Lynagh [Fri, 20 Jun 2008 01:13:18 +0000 (01:13 +0000)]
Fix warnings in directory

15 years agoMake currentDirectory001 not conflict with other tests running in parallel
Ian Lynagh [Wed, 11 Jun 2008 18:08:44 +0000 (18:08 +0000)]
Make currentDirectory001 not conflict with other tests running in parallel

16 years agounbreak previous patch for nhc98 2008-05-28
Malcolm.Wallace@cs.york.ac.uk [Wed, 20 Feb 2008 10:24:53 +0000 (10:24 +0000)]
unbreak previous patch for nhc98

16 years agogetTemporaryDirectory: be more precise when catching exns from getEnv
Simon Marlow [Mon, 18 Feb 2008 12:29:08 +0000 (12:29 +0000)]
getTemporaryDirectory: be more precise when catching exns from getEnv

16 years agomake this test work on Windows
Simon Marlow [Tue, 5 Feb 2008 14:54:50 +0000 (14:54 +0000)]
make this test work on Windows
I have no idea why it worked before

16 years agocanonicalizePath should also do System.FilePath.normalise
Simon Marlow [Tue, 22 Jan 2008 16:59:14 +0000 (16:59 +0000)]
canonicalizePath should also do System.FilePath.normalise
The example I've found where this is necessary is on Windows:
canonicalizePath on its own doesn't upper-case the drive letter, but
normalise does.

16 years agoFix a URL
Ian Lynagh [Mon, 26 Nov 2007 21:42:52 +0000 (21:42 +0000)]
Fix a URL

16 years agofix imports for non-GHC
Ross Paterson [Sat, 17 Nov 2007 14:40:59 +0000 (14:40 +0000)]
fix imports for non-GHC

16 years agoSpecify build-type: Configure
Duncan Coutts [Thu, 18 Oct 2007 12:49:40 +0000 (12:49 +0000)]
Specify build-type: Configure

16 years agothis sneaked in somehow
Simon Marlow [Thu, 18 Oct 2007 13:32:20 +0000 (13:32 +0000)]
this sneaked in somehow

16 years agoadd test for #1652
Simon Marlow [Thu, 18 Oct 2007 13:06:23 +0000 (13:06 +0000)]
add test for #1652

16 years agoimport System.Directory, not Directory
Simon Marlow [Thu, 18 Oct 2007 12:17:55 +0000 (12:17 +0000)]
import System.Directory, not Directory

16 years agomove copyFile001 from testsuite
Simon Marlow [Thu, 18 Oct 2007 12:14:05 +0000 (12:14 +0000)]
move copyFile001 from testsuite

16 years agoMove tests from testsuite/tests/ghc-regress/lib/Directory
Simon Marlow [Thu, 18 Oct 2007 12:01:15 +0000 (12:01 +0000)]
Move tests from testsuite/tests/ghc-regress/lib/Directory

16 years agoAdd more entries to boring file
Ian Lynagh [Thu, 13 Sep 2007 21:05:26 +0000 (21:05 +0000)]
Add more entries to boring file

16 years agoAdd a boring file
Ian Lynagh [Thu, 13 Sep 2007 20:46:48 +0000 (20:46 +0000)]
Add a boring file

16 years agoFixed permission setting in copyFile 2007-09-13 ghc-6_8_branched_2007-09-03
sven.panne@aedion.de [Sun, 2 Sep 2007 12:55:21 +0000 (12:55 +0000)]
Fixed permission setting in copyFile
Copy the permissions to the *temporary* file before moving it, no to the
probably non-existing real destination file. Before this fix, "try" silently
wiped this bug under the carpet, leading to silently broken permissions.

16 years agodelete configure droppings in setup clean
Simon Marlow [Fri, 24 Aug 2007 10:41:06 +0000 (10:41 +0000)]
delete configure droppings in setup clean

16 years agoFIX #1280: getPermissions wasn't working on Vista
Simon Marlow [Thu, 23 Aug 2007 11:16:05 +0000 (11:16 +0000)]
FIX #1280: getPermissions wasn't working on Vista
It turns out that _access() in the Windows C runtime used to ignore
the X_OK flag, in Vista it now returns an error.  After browsing the C
runtime sources, I discovered that _stat() has an almost but not quite
completely bogus implementation of the st_mode field, which lets us
implement a slightly less incorrect approximation to getPermissions than does
_access().

16 years agoRestore working version of copyFile for nhc98.
Malcolm.Wallace@cs.york.ac.uk [Sat, 4 Aug 2007 09:28:15 +0000 (09:28 +0000)]
Restore working version of copyFile for nhc98.
The recent patch changing its implementation was insufficiently portable.

16 years agoUse Control.Exception exception handlers, and make copyFile meet its spec
Ian Lynagh [Sun, 22 Jul 2007 11:26:49 +0000 (11:26 +0000)]
Use Control.Exception exception handlers, and make copyFile meet its spec
copyFile wasn't atomic before

16 years agoFix whitespace
Ian Lynagh [Sun, 22 Jul 2007 10:34:05 +0000 (10:34 +0000)]
Fix whitespace

16 years agoFix doesDirectoryExist; fixes trac #1490
Ian Lynagh [Sat, 21 Jul 2007 20:01:54 +0000 (20:01 +0000)]
Fix doesDirectoryExist; fixes trac #1490
We used to always strip trailing path separators from the path we were
given, but mingw's stat succeeds for C:\ and C:\foo but fails for C:
and C:\foo\. Thus we now use a trailing slash if and only if the path
we are given is a drive.

16 years agoOoops, we don't have dropDrive
Ian Lynagh [Sun, 1 Jul 2007 22:25:33 +0000 (22:25 +0000)]
Ooops, we don't have dropDrive
Without it we sometimes do a redundant directory creation attempt, but
no harm should be done.

16 years agoUse filepath rather than our own System.Directory.Internals
Ian Lynagh [Sat, 30 Jun 2007 12:52:44 +0000 (12:52 +0000)]
Use filepath rather than our own System.Directory.Internals

16 years agoAdd makeRelativeToCurrentDirectory
Ian Lynagh [Sat, 30 Jun 2007 10:58:34 +0000 (10:58 +0000)]
Add makeRelativeToCurrentDirectory
Moved from the filepath package, which we now depend on.

16 years agoAvoid using C comments in Haskell code :-)
Malcolm.Wallace@cs.york.ac.uk [Wed, 27 Jun 2007 10:39:23 +0000 (10:39 +0000)]
Avoid using C comments in Haskell code :-)

16 years agoinstall HsDirectoryConfig.h
Bertram Felgenhauer [Wed, 13 Jun 2007 04:03:40 +0000 (04:03 +0000)]
install HsDirectoryConfig.h

16 years ago#undef PACKAGE_NAME and friends to avoid clashes
Simon Marlow [Wed, 6 Jun 2007 14:21:53 +0000 (14:21 +0000)]
#undef PACKAGE_NAME and friends to avoid clashes

16 years ago--configure-option and --ghc-option are now provided by Cabal
Ross Paterson [Mon, 4 Jun 2007 11:59:35 +0000 (11:59 +0000)]
--configure-option and --ghc-option are now provided by Cabal

16 years agoCpp exclusion macro -> defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
Malcolm.Wallace@cs.york.ac.uk [Fri, 25 May 2007 10:25:40 +0000 (10:25 +0000)]
Cpp exclusion macro -> defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
  Nhc98 does not define the symbol __NHC__ when compiling C code.

16 years agoall but NHC
Ross Paterson [Fri, 25 May 2007 00:51:19 +0000 (00:51 +0000)]
all but NHC

16 years agoupdate CFILES pragma (used by Hugs only)
Ross Paterson [Fri, 25 May 2007 00:16:25 +0000 (00:16 +0000)]
update CFILES pragma (used by Hugs only)

16 years agoglasgow only
Malcolm.Wallace@cs.york.ac.uk [Thu, 24 May 2007 14:45:08 +0000 (14:45 +0000)]
glasgow only

16 years agoPut configure.ac back in the repo; not sure how it got removed
Ian Lynagh [Thu, 24 May 2007 14:17:45 +0000 (14:17 +0000)]
Put configure.ac back in the repo; not sure how it got removed

16 years agoNeed shlobj.h on Windows
Ian Lynagh [Wed, 23 May 2007 20:09:04 +0000 (20:09 +0000)]
Need shlobj.h on Windows

16 years agoRejig the #ifdeffery directory_2007-05-24
Ian Lynagh [Sun, 20 May 2007 15:57:43 +0000 (15:57 +0000)]
Rejig the #ifdeffery
Put __hscore_?_OK and __hscore_S_I?USR in the C inside
#ifdef __GLASGOW_HASKELL__ to match the foreign imports in the Haskell
code.

Don't check the constants are defined before defining the C functions,
as we assume that the functions exist in the Haskell code anyway.

16 years agoTiny refactoring
Ian Lynagh [Sun, 20 May 2007 15:43:57 +0000 (15:43 +0000)]
Tiny refactoring

16 years agoRemove non-directory stuff (of base), and rename package to "directory"
Ian Lynagh [Sat, 19 May 2007 11:54:19 +0000 (11:54 +0000)]
Remove non-directory stuff (of base), and rename package to "directory"

16 years agoRemove Control.Parallel*, now in package parallel
Ian Lynagh [Fri, 18 May 2007 16:54:31 +0000 (16:54 +0000)]
Remove Control.Parallel*, now in package parallel

16 years agoRemove the pretty-printing modules (now in package pretty(
Ian Lynagh [Fri, 18 May 2007 16:25:21 +0000 (16:25 +0000)]
Remove the pretty-printing modules (now in package pretty(

16 years agoadd install-includes: field
Simon Marlow [Thu, 17 May 2007 09:49:48 +0000 (09:49 +0000)]
add install-includes: field

16 years agocorrect the documentation for newForeignPtr
Simon Marlow [Wed, 16 May 2007 08:20:19 +0000 (08:20 +0000)]
correct the documentation for newForeignPtr

16 years agoWhen doing safe writes, handle EAGAIN rather than raising an exception
Simon Marlow [Tue, 15 May 2007 11:46:15 +0000 (11:46 +0000)]
When doing safe writes, handle EAGAIN rather than raising an exception
It might be that stdin was set to O_NONBLOCK by someone else, and we
should handle this case.  (this happens with GHCi, I'm not quite sure why)

16 years agoUse FilePath to make paths when building GHC/Prim.hs and GHC/PrimopWrappers.hs
Ian Lynagh [Mon, 14 May 2007 11:04:09 +0000 (11:04 +0000)]
Use FilePath to make paths when building GHC/Prim.hs and GHC/PrimopWrappers.hs

16 years agoBuild GHC/Prim.hs and GHC/PrimopWrappers.hs from Cabal
Ian Lynagh [Wed, 9 May 2007 14:26:55 +0000 (14:26 +0000)]
Build GHC/Prim.hs and GHC/PrimopWrappers.hs from Cabal

16 years agofix imports for non-GHC
Ross Paterson [Sun, 13 May 2007 00:11:38 +0000 (00:11 +0000)]
fix imports for non-GHC

16 years agoGive an example of how intersection takes elements from the first set
Ian Lynagh [Sat, 12 May 2007 16:02:53 +0000 (16:02 +0000)]
Give an example of how intersection takes elements from the first set

16 years agofurther clarify the docs for 'evaluate'
Malcolm.Wallace@cs.york.ac.uk [Tue, 8 May 2007 10:11:24 +0000 (10:11 +0000)]
further clarify the docs for 'evaluate'

16 years agoimprove documentation for evaluate
Simon Marlow [Tue, 8 May 2007 08:17:12 +0000 (08:17 +0000)]
improve documentation for evaluate

16 years agoFIX: #724 (tee complains if used in a process started by ghc)
Simon Marlow [Mon, 7 May 2007 12:35:37 +0000 (12:35 +0000)]
FIX: #724 (tee complains if used in a process started by ghc)

Now, we only set O_NONBLOCK on file descriptors that we create
ourselves.  File descriptors that we inherit (stdin, stdout, stderr)
are kept in blocking mode.  The way we deal with this differs between
the threaded and non-threaded runtimes:

 - with -threaded, we just make a safe foreign call to read(), which
   may block, but this is ok.

 - without -threaded, we test the descriptor with select() before
   attempting any I/O.  This isn't completely safe - someone else
   might read the data between the select() and the read() - but it's
   a reasonable compromise and doesn't seem to measurably affect
   performance.

17 years agothe "unknown" types are no longer required
Simon Marlow [Thu, 26 Apr 2007 13:59:31 +0000 (13:59 +0000)]
the "unknown" types are no longer required

16 years agoMake Control.Exception buildable by nhc98.
Malcolm.Wallace@cs.york.ac.uk [Fri, 4 May 2007 10:55:48 +0000 (10:55 +0000)]
Make Control.Exception buildable by nhc98.
The nhc98 does not have true exceptions, but these additions should be
enough infrastructure to pretend that it does.  Only IO exceptions will
actually work.

16 years agoTrim imports, remove a cycle
simonpj@microsoft [Thu, 3 May 2007 12:30:10 +0000 (12:30 +0000)]
Trim imports, remove a cycle

A first attempt at removing gratuitous cycles in the base package.
I've removed the useless module GHC.Dynamic, which gets rid of a cycle;
and trimmed off various unnecesary imports.

This also fixes the IsString import problem.

16 years agoBe less quiet about building the base package
simonpj@microsoft [Thu, 3 May 2007 09:37:07 +0000 (09:37 +0000)]
Be less quiet about building the base package

17 years agoRemove Splittable class (a vestige of linear implicit parameters)
simonpj@microsoft [Wed, 21 Feb 2007 10:43:29 +0000 (10:43 +0000)]
Remove Splittable class (a vestige of linear implicit parameters)

17 years agoAdd IsString to exports of GHC.Exts
simonpj@microsoft [Wed, 21 Feb 2007 10:42:49 +0000 (10:42 +0000)]
Add IsString to exports of GHC.Exts