Skip to content

Commit

Permalink
Add AFPP support
Browse files Browse the repository at this point in the history
  • Loading branch information
hasufell committed Jun 25, 2022
1 parent 4556d3c commit 66b3f48
Show file tree
Hide file tree
Showing 25 changed files with 3,134 additions and 2,255 deletions.
1,559 changes: 4 additions & 1,555 deletions System/Directory.hs

Large diffs are not rendered by default.

142 changes: 142 additions & 0 deletions System/Directory/AbstractFilePath.hs
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"
30 changes: 30 additions & 0 deletions System/Directory/Internal/AbstractFilePath.hs
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
Loading

0 comments on commit 66b3f48

Please sign in to comment.