-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
3,134 additions
and
2,255 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
{-# LANGUAGE CPP #-} | ||
|
||
#if !MIN_VERSION_base(4, 8, 0) | ||
-- In base-4.8.0 the Foreign module became Safe | ||
{-# LANGUAGE Trustworthy #-} | ||
#endif | ||
|
||
----------------------------------------------------------------------------- | ||
-- | | ||
-- Module : System.Directory.AbstractFilePath | ||
-- Copyright : (c) The University of Glasgow 2001 | ||
-- License : BSD-style (see the file libraries/base/LICENSE) | ||
-- | ||
-- Maintainer : [email protected] | ||
-- Stability : stable | ||
-- Portability : portable | ||
-- | ||
-- System-independent interface to directory manipulation. | ||
-- | ||
----------------------------------------------------------------------------- | ||
|
||
module System.Directory.AbstractFilePath | ||
( | ||
-- $intro | ||
|
||
-- * Types | ||
AbstractFilePath | ||
, OsString | ||
|
||
-- * Actions on directories | ||
, createDirectory | ||
, createDirectoryIfMissing | ||
, removeDirectory | ||
, removeDirectoryRecursive | ||
, removePathForcibly | ||
, renameDirectory | ||
, listDirectory | ||
, getDirectoryContents | ||
-- ** Current working directory | ||
, getCurrentDirectory | ||
, setCurrentDirectory | ||
, withCurrentDirectory | ||
|
||
-- * Pre-defined directories | ||
, getHomeDirectory | ||
, XdgDirectory(..) | ||
, getXdgDirectory | ||
, XdgDirectoryList(..) | ||
, getXdgDirectoryList | ||
, getAppUserDataDirectory | ||
, getUserDocumentsDirectory | ||
, getTemporaryDirectory | ||
|
||
-- * Actions on files | ||
, removeFile | ||
, renameFile | ||
, renamePath | ||
, copyFile | ||
, copyFileWithMetadata | ||
, getFileSize | ||
|
||
, canonicalizePath | ||
, makeAbsolute | ||
, makeRelativeToCurrentDirectory | ||
|
||
-- * Existence tests | ||
, doesPathExist | ||
, doesFileExist | ||
, doesDirectoryExist | ||
|
||
, findExecutable | ||
, findExecutables | ||
, findExecutablesInDirectories | ||
, findFile | ||
, findFiles | ||
, findFileWith | ||
, findFilesWith | ||
, exeExtension | ||
|
||
-- * Symbolic links | ||
, createFileLink | ||
, createDirectoryLink | ||
, removeDirectoryLink | ||
, pathIsSymbolicLink | ||
, getSymbolicLinkTarget | ||
|
||
-- * Permissions | ||
|
||
-- $permissions | ||
|
||
, Permissions | ||
, emptyPermissions | ||
, readable | ||
, writable | ||
, executable | ||
, searchable | ||
, setOwnerReadable | ||
, setOwnerWritable | ||
, setOwnerExecutable | ||
, setOwnerSearchable | ||
|
||
, getPermissions | ||
, setPermissions | ||
, copyPermissions | ||
|
||
-- * Timestamps | ||
|
||
, getAccessTime | ||
, getModificationTime | ||
, setAccessTime | ||
, setModificationTime | ||
|
||
-- * Deprecated | ||
, isSymbolicLink | ||
|
||
) where | ||
import Prelude () | ||
import System.Directory.Internal.AbstractFilePath | ||
import System.Directory.Internal.Prelude hiding (lookupEnv) | ||
import System.AbstractFilePath | ||
( (<.>) | ||
, (</>) | ||
, addTrailingPathSeparator | ||
, dropTrailingPathSeparator | ||
, hasTrailingPathSeparator | ||
, isAbsolute | ||
, joinPath | ||
, makeRelative | ||
, splitDirectories | ||
, splitSearchPath | ||
, takeDirectory | ||
, AbstractFilePath | ||
, OsString | ||
) | ||
import Data.Time (UTCTime) | ||
import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds) | ||
import Data.String ( fromString ) | ||
|
||
|
||
#define FILEPATH AbstractFilePath | ||
#define STRING OsString | ||
#include "Template.hs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{-# LANGUAGE CPP #-} | ||
-- | | ||
-- Stability: unstable | ||
-- Portability: unportable | ||
-- | ||
-- Internal modules are always subject to change from version to version. | ||
-- The contents of this module are also platform-dependent, hence what is | ||
-- shown in the Hackage documentation may differ from what is actually | ||
-- available on your system. | ||
|
||
#include <HsDirectoryConfig.h> | ||
|
||
module System.Directory.Internal.AbstractFilePath | ||
( module System.Directory.Internal.Common.AbstractFilePath | ||
|
||
#if defined(mingw32_HOST_OS) | ||
, module System.Directory.Internal.Windows.AbstractFilePath | ||
#else | ||
, module System.Directory.Internal.Posix.AbstractFilePath | ||
#endif | ||
|
||
) where | ||
|
||
import System.Directory.Internal.Common.AbstractFilePath | ||
|
||
#if defined(mingw32_HOST_OS) | ||
import System.Directory.Internal.Windows.AbstractFilePath | ||
#else | ||
import System.Directory.Internal.Posix.AbstractFilePath | ||
#endif |
Oops, something went wrong.