directory
Platform-agnostic library for filesystem operations
| Version on this page: | 1.3.6.0 |
| LTS Haskell 24.16: | 1.3.8.5 |
| Stackage Nightly 2025-10-24: | 1.3.9.0 |
| Latest on Hackage: | 1.3.9.0@rev:2 |
directory-1.3.6.0@sha256:d3d89c752f99e78f3e1d11c74696d2ba78b199f47c89e92934003deb84cb3ff9,2810Module documentation for 1.3.6.0
directory
Documentation can be found on Hackage. Changes between versions are recorded in the change log.
Building from Git repository
When building this package directly from the Git repository, one must run
autoreconf -fi to generate the configure script needed by cabal configure. This requires Autoconf to be installed.
autoreconf -fi
cabal install
There is no need to run the configure script manually however, as cabal configure does that automatically.
Changes
Changelog for the directory package
1.3.6.0 (January 2020)
- On non-Windows platforms,
getHomeDirectorywill fall back togetpwuid_rifHOMEis not set. (#102)
1.3.5.0 (December 2019)
- Revert change introduced in the version
1.3.3.2: Non-absoluteXDG_*environment variables are ignored. This behavior is according to XDG Base Directory Specification version 0.7 (#100)
1.3.4.0 (July 2019)
getXdgDirectoryandgetXdgDirectoryListon Windows will now respect the XDG environment variables if present. (#95)
1.3.3.2 (January 2019)
getXdgDirectorywill no longer reject environment variables containing relative paths. (#87)
1.3.3.1 (August 2018)
doesDirectoryExistanddoesPathExistreject empty paths once again, reversing an undocumented change introduced in 1.3.1.1. (#84)
1.3.3.0 (June 2018)
-
Relax
unixversion bounds to support 2.8. -
Relax
Win32version bounds to support 2.8. -
Use
SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATEwhen creating symbolic links on Windows, if possible. (#83)
1.3.2.2 (April 2018)
- Relax
baseversion bounds to support 4.12.
1.3.2.1 (March 2018)
- Relax
Win32version bounds to support 2.7.
1.3.2.0 (January 2018)
-
Relax
timeversion bounds to support 1.9. -
Implement
getXdgDirectoryListandXdgDirectoryList. (#78)
1.3.1.5 (October 2017)
- Rename the internal header
windows.hto avoid GHC#14312. (#77)
1.3.1.4 (September 2017)
- Fix
Win32version 2.6 compatibility. (#75)
1.3.1.3 (September 2017)
- Relax
Win32version bounds to support 2.6.
1.3.1.2 (September 2017)
- Relax
baseversion bounds to support 4.11. (#74)
1.3.1.1 (March 2017)
-
Fix a bug where
createFileLinkandcreateDirectoryLinkfailed to handle..in absolute paths. -
Improve support (partially) for paths longer than 260 characters on Windows. To achieve this, many functions will now automatically prepend
\\?\before calling the Windows API. As a side effect, the\\?\prefix may show up in the error messages of the affected functions. -
makeAbsolutecan now handle drive-relative paths on Windows such asC:foobar
1.3.1.0 (March 2017)
-
findFile(and similar functions): when an absolute path is given, the list of search directories is now completely ignored. Previously, if the list was empty,findFilewould always fail. (#72) -
For symbolic links on Windows, the following functions had previously interpreted paths as referring to the links themselves rather than their targets. This was inconsistent with other platforms and has been fixed.
getFileSizedoesPathExistdoesDirectoryExistdoesFileExist
-
Fix incorrect location info in errors from
pathIsSymbolicLink. -
Add functions for symbolic link manipulation:
createFileLinkcreateDirectoryLinkremoveDirectoryLinkgetSymbolicLinkTarget
-
canonicalizePathcan now resolve broken symbolic links too. (#64)
1.3.0.2 (February 2017)
-
[optimization] Increase internal buffer size of
copyFile(#69) -
Relax
timeversion bounds to support 1.8.
1.3.0.1 (January 2017)
- Relax
Win32version bounds to support 2.5. (#67)
1.3.0.0 (December 2016)
-
[breaking] Drop trailing slashes in
canonicalizePath(#63) -
[deprecation] Rename
isSymbolicLinktopathIsSymbolicLink. The old name will remain available but may be removed in the next major release. (#52) -
Changed
canonicalizePathto dereference symbolic links even if it points to a file and is not the last path segment -
On Windows,
canonicalizePathnow canonicalizes the letter case too -
On Windows,
canonicalizePathnow also dereferences symbolic links -
When exceptions are thrown, the error location will now contain additional information about the internal function(s) used.
1.2.7.1 (November 2016)
- Don’t abort
removePathForciblyif files or directories go missing. In addition, keep going even if an exception occurs. (#60)
1.2.7.0 (August 2016)
-
Remove deprecated C bits. This means
HsDirectory.hand its functions are no longer available. (#50) -
Add
doesPathExistandgetFileSize(#57) -
Add
renamePath(#58) -
Add
removePathForcibly(#59)
1.2.6.3 (May 2016)
- Add missing import of
(<*>)on Windows forbaseearlier than 4.8.0.0 (#53)
1.2.6.2 (April 2016)
-
Bundled with GHC 8.0.1
-
Fix typo in file time functions when
utimensatis not available and version ofunixpackage is lower than 2.7.0.0
1.2.6.1 (April 2016)
- Fix mistake in file time functions when
utimensatis not available (#47)
1.2.6.0 (April 2016)
-
Make
findExecutable,findExecutables,findExecutablesInDirectories,findFile, andfindFilesWithlazier (#43) -
Add
findFileWith -
Add
copyFileWithMetadata, which copies additional metadata (#40) -
Improve error message of
removeDirectoryRecursivewhen used on a directory symbolic link on Windows. -
Add
isSymbolicLink -
Drop support for Hugs.
1.2.5.1 (February 2016)
-
Improve error message of
getCurrentDirectorywhen the current working directory no longer exists (#39) -
Fix the behavior of trailing path separators in
canonicalizePathas well asmakeAbsolutewhen applied to the current directory; they should now match the behavior ofcanonicalizePathprior to 1.2.3.0 (when the bug was introduced) (#42) -
Set the location in IO errors from
makeAbsolute.
1.2.5.0 (December 2015)
-
Add
listDirectory, which is similar togetDirectoryContentsbut omits.and..(#36) -
Remove support for
--with-cc=inconfigure; use theCC=flag instead (ghc:D1608)
1.2.4.0 (September 2015)
-
Work around lack of
#const_strwhen cross-compiling (haskell-cafe) -
Add
findExecutablesInDirectories(#33) -
Add
exeExtension
1.2.3.1 (August 2015)
- Restore support for Safe Haskell with base < 4.8 (#30)
1.2.3.0 (July 2015)
-
Add support for XDG Base Directory Specification (#6)
-
Implement
setModificationTimecounterpart togetModificationTime(#13) -
Implement
getAccessTimeandsetAccessTime -
Set the filename in IO errors from the file time functions
-
Fix
canonicalizePathso that it always returns a reasonable result even if the path is inaccessible and will not throw exceptions unless the current directory cannot be obtained (#23) -
Corrected the trailing slash behavior of
makeAbsoluteso thatmakeAbsolute "" == makeAbsolute "." -
Deprecate use of
HsDirectory.handHsDirectoryConfig.h -
Implement
withCurrentDirectory
1.2.2.1 (Apr 2015)
- Fix dependency problem on NixOS when building with tests (#24)
1.2.2.0 (Mar 2015)
-
Bundled with GHC 7.10.1
-
Make
getModificationTimesupport sub-second resolution on Windows -
Fix silent failure in
createDirectoryIfMissing -
Replace
throwby better definedthrowIOs -
Avoid stack overflow in
getDirectoryContents(#17) -
Expose
findExecutables(#14) -
removeDirectoryRecursiveno longer follows symlinks under any circumstances (#15) -
Allow trailing path separators in
getPermissionson Windows (#9) -
renameFilenow always throws the correct error type (InappropriateType) when the destination is a directory, as long as the filesystem is not being modified concurrently (#8) -
Add
makeAbsolute, which should be preferred overcanonicalizePathunless one requires symbolic links to be resolved
1.2.1.0 (Mar 2014)
-
Bundled with GHC 7.8.1
-
Add support for sub-second precision in
getModificationTimewhen linked againstunix>=2.6.0.0 -
Fix
createDirectoryIfMissing _ "."inC:\on Windows -
Remove support for NHC98 compiler
-
Update package to
cabal-version >= 1.10format -
Enhance Haddock documentation for
doesDirectoryExistandcanonicalizePath -
Fix
findExecutableto check that file permissions indicate executable -
New convenience functions
findFilesandfindFilesWith