| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Consider `ln` (or any other Unix tool):
$ ln -s file1 file2
$ ls -l file2
lrwxrwxrwx 1 niklas niklas 5 Feb 8 03:09 file2 -> file1
$ ln -s file1 file2
ln: failed to create symbolic link 'file2': File exists
The file name mentioned in the error ("link2") is the one
that *could not be created*, not the content of the pointer.
`createSymbolicLink` got this wrong so far, it would print
file1: createSymbolicLink: already exists (File exists)
which is wrong, this file doesn't already exist.
This commit fixes it.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
`System.Posix.Files.fileAccess` fails inside OS X sandbox
|
| |
| |
| |
| |
| | |
This makes sure we pick up the LFS version of `truncate` in case `off_t`
is affected by CPP defines such as `_FILE_OFFSET_BITS`.
|
|/
|
|
|
|
|
| |
This is useful on OS X when its sandboxing mechanism is used, because
that will set errno = EPERM when a file can't be written due to
sandboxing (as opposed to setting it to EACCES when file permissions
deny writing).
|
|
|
|
|
| |
This makes it more obvious why `unix` depends on `time` in the first
place, i.e. for the sole purpose of reusing the `POSIXTime` type.
|
|
|
|
|
|
|
|
|
| |
Solaris
Patch provided by Christian Maeder <Christian.Maeder@dfki.de>
Signed-off-by: Karel Gardas <karel.gardas@centrum.cz>
Signed-off-by: Austin Seipp <austin@well-typed.com>
|
|
|
|
| |
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
|
|
|
|
|
|
| |
This extends `System.Posix.Files.`access` to map EROFS & ETXTBSY to
mean permission denied just like EACCESS.
Based on a patch by Alain O'Dea and comments by Duncan Coutts
Authored-by: Alain O'Dea <alain.odea@verafin.com>
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
|
|
|
|
|
| |
CPP conditional code sections have been carefully taken into account
while performing this warning cleanup. Most `OPTIONS_GHC` declarations
could be dropped (now only a lonely `{-# OPTIONS_GHC -fno-cse #-}`
remains in `Posix.Signals`).
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
|
|
|
| |
The changelog file will be shown on Hackage once it's included in the
source tarball.
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
|
|
|
|
|
| |
Only language extensions not active when `-XHaskell2010` is enabled are
declared, this way we can drop many redundant
`{-# LANGUAGE ForeignFunctionInterface #-}` occurences. This commit also
removes/replaces some `{-# OPTIONS_GHC -XRecordWildCards #-}` pragmas.
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
|
|
|
|
| |
and remove code to support older versions
|
| |
|
|
|
|
| |
Signed-off-by: Paolo Capriotti <p.capriotti@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new module System.Posix.ByteString provides exactly the same API
as System.Posix, except that:
- There is a new type: RawFilePath = ByteString
- All functions mentioning FilePath in the System.Posix API
use RawFilePath in the System.Posix.ByteString API
- RawFilePaths are not subject to Unicode locale encoding and
decoding, unlike FilePaths. They are the exact bytes passed to and
returned from the underlying POSIX API.
- Similarly for functions that deal in environment
strings (System.Posix.Env): these use untranslated ByteStrings
in System.Posix.Environment
- There is a new function
System.Posix.ByteString.getArgs :: [ByteString]
returning the raw untranslated arguments as passed to exec() when
the program was started.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Using CInt makes it much easier to verify that it is right, and we won't
get caught out by possible newtype switches between CInt/Int.
|
| |
|
|
|
|
| |
(of the dubiously exported c_access and c_fcntl_write)
|
| |
|
| |
|
| |
|
|
|
|
| |
Some docs for System.Posix, from Bj?rn Bringert
|
|
|
|
| |
PATH_MAX fixes from Thomas Schwinge.
|
|
|
|
| |
c_ftruncate is now in System.Posix.Internals
|
|
|
|
|
|
|
|
|
| |
Add filenames to all errors where it makes sense. I've added
System.Posix.Error with a new family of error-throwing functions,
throwErrnoPath*. This seemed to make the most sense: they don't
belong in Foreign.C.Error (C by itself has no notion of paths).
Fixes: [ 954378 ] getFileStatus does not include the file name in IO-Error
|
|
|
|
| |
fileExist should not throw an exception if the file does not exist.
|
|
|
|
|
|
|
|
| |
#ifdef's for the _PC_SYNC_IO, _PC_ASYNC_IO, _PC_FILESIZEBITS,
_PC_SYMLINK_MAX.
These 4 symbols are not universal: FreeBSD and Linux and the only
OS's that appear to have them at the moment.
|
|
|
|
| |
Implement pathconf()/fpathconf() wrappers.
|
|
|
|
| |
rename GHC.Posix as System.Posix.Internals
|
|
|
|
|
|
|
|
|
| |
Fill in some more bits in the new Unix library: specifically the
contents of PosixTTY and PosixDB (now System.Posix.Terminal and
System.Posix.User respectively).
We're now about 95% complete w.r.t. the old posix library. I've
identified the reminaing bits to do in System/Posix.hs.
|
|
|
|
|
|
| |
readlink(2) does not append a NUL character to buffer.
Noticed by: John Meacham <john@repetae.net>
|
|
|
|
|
|
|
|
|
| |
Make the new Posix bindings compile on Mac OS X.
Most notable, Mac OS X lacks
*) lchown
*) SIGPOLL
I don't know of a replacement of either, so they are just left out when
they are not detected by configure.
|
|
|
|
| |
More POSIX bits... we're getting there.
|
|
Partial rewrite of the POSIX library.
The main purpose of this sweep is to remove the last dependencies of
the compiler on hslibs. When I've committed the associated compiler
changes, only the 'base' package will be required to bootstrap the
compiler. Additionally to build GHCi, the 'readline' and 'unix'
packages will be required.
The new POSIX library lives mostly in libraries/unix, with a few bits
required for compiler bootstrapping in libraries/base. The 'base'
package is mostly free of hsc2hs code to make bootstrapping from HC
files easier, but the 'unix' package will use hsc2hs liberally.
The old POSIX library continues to provide more-or-less the same
interface as before, although some of the types are more correct now
(previously lots of POSIX types were just mapped to Int). The new
interface is largely the same as the old, except that some new
functionality from the latest POSIX spec has been added (eg. symbolic
links).
So far, the new POSIX library has signal support, directory/file
operations and lots of stuff from unistd.h. The module names are:
System.Posix
The main dude, exports everything
System.Posix.Types
All the POSIX types, using the same naming scheme as
Foreign.C.Types, Eg. CUid, COff, etc. Many of these types
were previously exported by GHC.Posix.
Additionally exports the "nicer" names used by the old POSIX
library for compatibility (eg. ProcessID == CPid, FileMode ==
CMode, etc.)
All reasonable instances are derived for these types.
System.Posix.Signals
Signal support, contains most of which was in PosixProcPrim before.
The RTS interface to the signal handling support has been
rationalised slightly.
System.Posix.Directory
Directory support, most were in PosixFiles before.
System.Posix.Files
File operations, most were in PosixFiles before.
System.Posix.Unistd
(for want of a better name) Miscellaneous bits that mostly come
from the unistd.h header file. PosixProcEnv before.
The rest of the library should pan out like so:
System.Posix.IO
System.Posix.Error (maybe)
System.Posix.Process
System.Posix.Terminal
(I've no doubt broken Win32 support, but I'm checking the build at the moment).
|