h*D'?      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~               0.3.0.0  Safe-Inferred2fs-apiCallStack with  instance using  Safe-Inferred6 fs-api#Condensed but human-readable output fs-apiLift the standard  & function through the type constructor     Safe-Inferred %&1<'fs-apie.g the user tried to open a directory with hOpen rather than a file.0fs-apiUsed for all other error types3fs-api Error type4fs-apiPath to the file5fs-apiHuman-readable string giving additional information about the error6fs-apiThe /, if available. This is more precise than the %.7fs-api Call stack8fs-api:Is this error due to a limitation of the mock file system?The mock file system does not all of Posix's features and quirks. This flag will be set for such unsupported IO calls. Real I/O calls would not have thrown an error for these calls.>fs-apiThe raw underlying handle?fs-api%The path corresponding to this handle-This is primarily useful for error reporting.@fs-apiFor better error reporting to the end user, we want to include the mount point of the file. But the mountpoint may not always be available, like when we mock the fs or we simulate fs errors.Bfs-api Mount pointDs are not absolute paths, but must be interpreted with respect to a particualar mount point.Dfs-apiA relative path. InvariantThe user of this library is tasked with picking sensible names of directories/files on a path. Amongst others, the following should hold:Names are non-empty1Names are monotonic, i.e., they are not equal to ..9Names should not contain path separators or drive lettersIn particular, names that satisfy these invariants should result in an D that remains relative to the HasFS instance root. For example, an D ["/"] would try to access the root folder, which is most likely outside of the scope of the HasFS instance.".." should not be used because fs-sim8 will not be able to follow these types of back-links. fs-sim will interpret ".." as a directory name instead.Ffs-apiWhen opening a file:Gfs-apiThe file may already exist. If it does, it is reopened. If it doesn't, it is created.Hfs-api3The file may not yet exist. If it does, an error (* ) is thrown.Ifs-apiHow to   a new file.Ofs-apiCreate a path from a list of directory/file names. All of the names should be non-empty.Pfs-apiConstructor for D ensures path is in normal formQfs-apiSplit D is essentially (init fp, last fp)Like init and last,  if empty.Rfs-api$Drop the final component of the pathUndefined if the path is empty.Sfs-api An alias for T.Tfs-api5Add an extension, even if there is already one there.This works similarly to  .Ufs-api An alias for V.Vfs-api(Combine two paths with a path separator.This works similarly to  , but since the arguments are relative paths, the corner cases for  do not apply. Specifically, the second path will never start with a path separator or a drive letter, so the result is simply the concatenation of the two paths.If either operand is empty, the other operand is returned. The result of combining two empty paths is the empty pathZfs-apiLike Y, but when we don't have a B[fs-api3Check if two errors are semantically the same error?9:;12345678@A%&'()*+,-./0YZ^\][_`FGHIJKLMNBCXORQEWPTSVUD<=>?9:;12345678@A%&'()*+,-./0YZ^\][_`T7V5 Safe-Inferred%&')*1, fs-api%Absolute offset into a buffer (i.e., ).Can be negative, because buffer offsets can be added together to change offset positions. This is similar to plusPtr for Ptr types. However, note that reading or writing from a buffer at a negative offset leads to undefined behaviour.fs-api6It is often inconvenient to have to parameterise over h'. This data type hides an existential h parameter of a .fs-api*Abstract interface for performing file I/O User-supplied buffers user-supplied-buffers=For functions that require user-supplied buffers (i.e., ), it is the user's responsiblity to provide buffers that are large enough. Behaviour is undefined if the I/O operations access the buffer outside it's allocated range.fs-api:Debugging: human-readable description of file system statefs-api Open a filefs-api Close a filefs-apiIs the handle open?fs-api Seek handleThe offset is an  rather than a ? because it may be negative (for use in relative positioning).Unlike the Posix lseek,  does not return the new seek position because the value returned by Posix is rather strange and unreliable and we don't want to emulate it's behaviour.fs-api Try to read n bytes from a handleWhen at the end of the file, an empty bytestring will be returned.3The returned bytestring will typically have length n, but may be shorter in case of a partial read, see #277. However, a partial read will always return at least 1 byte, as returning 0 bytes would mean that we have reached EOF.9Postcondition: for the length of the returned bytestring bs we have length bs >= 0 and length bs <= n.fs-apiSame as , but does not affect the file offset. An additional argument is used to specify the offset. This allows it to be called concurrently for the same file handle. However, the actual level of parallelism achieved depends on the implementation and the operating system: generally on Unix it will be "more parallel" than on Windows.fs-apiWrite to a handleThe return value indicates the number of bytes written and will typically be equal to l, the length of the bytestring, but may be shorter in case of a partial write, see #277.>If nothing can be written at all, an exception will be thrown. Postcondition: the return value n is n > 0 and n <= l7, unless the given bytestring is empty, in which case n can be 0.fs-api'Truncate the file to the specified size$NOTE: Only supported in append mode.fs-apiReturn current file sizeNOTE: This is not thread safe (changes made to the file in other threads may affect this thread).fs-apiCreate new directoryfs-api)Create new directory if it doesn't exist.createDirectoryIfMissing True) will also try to create all parent dirs.fs-apiList contents of a directoryfs-api+Check if the path exists and is a directoryfs-api&Check if the path exists and is a filefs-api8Remove the directory (which must exist) and its contentsfs-api"Remove the file (which must exist)fs-apiRename the file (which must exist) from the first path to the second path. If there is already a file at the latter path, it is replaced by the new one.2NOTE: only works for files within the same folder.fs-api!Useful for better error reportingfs-apiCreate an absolute  from a relative D.9This is an escape hatch for creating absolute paths when m ~.-Postcondition: Should throw an error for any m that is not IO (or for which we do not have MonadIO m).fs-apiLike ;, but the bytes are read into a user-supplied buffer. See  #user-supplied-buffersUser-supplied buffers.fs-apiLike ;, but the bytes are read into a user-supplied buffer. See  #user-supplied-buffersUser-supplied buffers.fs-apiLike >, but the bytes are written from a user-supplied buffer. See  #user-supplied-buffersUser-supplied buffers.fs-apiLike , but the bytes are written from a user-supplied buffer at a given file offset. This offset does not affect the offset stored in the file handle (see also ). See  #user-supplied-buffersUser-supplied buffers.fs-apiReturns  when the handle was still open.fs-api Wrapper for  that ensures that we read exactly as many bytes as requested. If EOF is found before the requested number of bytes is read, an 1 exception is thrown.fs-api Wrapper for  that ensures that we read exactly as many bytes as requested. If EOF is found before the requested number of bytes is read, an 1 exception is thrown.fs-api Wrapper for ; that ensures we write exactly as many bytes as requested.fs-api Wrapper for ; that ensures we write exactly as many bytes as requested.fs-apiBuffer to read bytes intofs-apiOffset into bufferfs-apiThe number of bytes to readfs-apiBuffer to read bytes intofs-apiOffset into bufferfs-apiThe number of bytes to readfs-api The file offset at which to readfs-apiBuffer to write bytes fromfs-apiOffset into bufferfs-apiThe number of bytes to writefs-apiBuffer to write bytes fromfs-apiOffset into bufferfs-apiThe number of bytes to writefs-api!The file offset at which to write<=>?IJKLMFGHBCDE9:;12345678@A%&'()*+,-./0VTSUNXORQWPYZ^\][_`% Safe-Inferred. fs-api(This function makes sure that the whole  is written.<=>?IJKLMFGHBCDE9:;12345678@A%&'()*+,-./0VTSUNXORQWPYZ^\][_` Safe-Inferred%&2Sfs-apiMakes sure it reads all requested bytes. If eof is found before all bytes are read, it throws an exception.fs-apiLike , but is thread safe since it does not change or depend on the file offset. pread syscall is used internally.fs-api?IJKLMFGHBCDE9:;12345678@A%&'()*+,-./0VTSUNXORQWPYZ^\][_` Safe-Inferred<4Xfs-api Variation on  that also computes a CRCfs-api Variation on  that also computes a CRCfs-api Variation on  that also computes a CRCfs-apiThe number of bytes to read.fs-apiThe offset at which to read.fs-apiThe offset at which to read.   Safe-Inferred6fs-apiFile handlers for the IO instance for HasFS. This is parametric on the os.The ) is used to improve error messages. The  is used to implement close2. osHandle is Fd for unix and HANDLE for Windows.fs-api2This is a no-op when the handle is already closed.fs-apiThis is meant to be used for the implementation of individual file system commands. Using it for larger scopes woud not be correct, since we would not notice if the handle is closed.  Safe-Inferred=D fs-apiSome sensible defaults for the  OpenFileFlags. NOTE: the unix package already% exports a smart constructor called defaultFileFlags already, but we define our own to not be depedent by whichever default choice unix's library authors made, and to be able to change our minds later if necessary. In particular, we are interested in the append and  exclusive flags, which were largely the reason why we introduced this low-level module.fs-apiOpens a file from disk.fs-apiWrites the data pointed by the input 'Ptr Word8' into the input .fs-apiSeek within the file.The offset may be negative.We don't return the new offset since the behaviour of lseek is rather odd (e.g., the file pointer may not actually be moved until a subsequent write)fs-api-Reads a given number of bytes from the input .fs-api fh buf c off reads c bytes into the buffer buf from the file handle fh at the file offset off6. This does not move the position of the file handle.fs-api fh buf c off writes c$ bytes from the data in the buffer buf to the file handle fh at the file offset off6. This does not move the position of the file handle.fs-api(Truncates the file managed by the input  to the input size.fs-api Close handle2This is a no-op when the handle is already closed.fs-api#File size of the given file pointerNOTE: This is not thread safe (changes made to the file in other threads may affect this thread).    Safe-Inferred>fs-api+File handlers for the IO instance for HasFSWe store the path the handle points to for better error messagesfs-api implementation of the  interface using the real file system.The concrete implementation depends on the OS distribution, but behaviour should be similar across distributions. !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHHIJKLMNOOPQQRSTTUUVWXXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                 $fs-api-0.3.0.0-9Af060UItM4vLHAUAXnQ0System.FS.CallStackSystem.FS.API.TypesSystem.FS.Condense System.FS.APISystem.FS.API.StrictSystem.FS.API.Lazy System.FS.CRCSystem.FS.IO.HandleSystem.FS.IO.Unix System.FS.IOfs-apihOpenFilepath<.>Foreign.C.ErrorerrnoToIOError System.IOErrorbaseGHC.Stack.Types HasCallStack GHC.IO.DeviceSeekMode AbsoluteSeek RelativeSeek SeekFromEndPrettyCallStackprettyCallStack$fShowPrettyCallStack Condense1 liftCondenseCondensecondense condense1$fCondenseByteString$fCondenseByteString0 $fCondenseMap$fCondense(,,,,)$fCondense(,,,)$fCondense(,,) $fCondense(,) $fCondenseSet$fCondenseMaybe$fCondenseList$fCondenseRatio$fCondenseText$fCondenseVoid$fCondense1Set$fCondense1List$fCondenseCondenseAsShow$fShowCondenseAsShow$fCondenseNatural$fCondenseWord64$fCondenseWord32$fCondenseWord$fCondenseInt64 $fCondenseInt$fCondenseBool FsErrorTypeFsIllegalOperationFsResourceInappropriateTypeFsResourceAlreadyInUseFsResourceDoesNotExistFsResourceAlreadyExist FsReachedEOF FsDeviceFullFsTooManyOpenFilesFsInsufficientPermissionsFsInvalidArgumentFsOtherFsError fsErrorType fsErrorPath fsErrorString fsErrorNo fsErrorStack fsLimitation AbsOffset unAbsOffsetHandle handleRaw handlePath FsErrorPath MountPointFsPath fsPathToList AllowExisting MustBeNewOpenModeReadMode WriteMode AppendMode ReadWriteMode allowExistingfsPathFromListmkFsPath fsPathSplit fsPathInit addExtensioncombine fsToFilePathfsFromFilePathfsToFsErrorPathfsToFsErrorPathUnmounted sameFsError isFsErrorType prettyFsError hasMountPoint ioToFsErrorioToFsErrorType$fCondenseSeekMode$fCondenseAllowExisting$fCondenseOpenMode$fCondenseFsPath $fShowFsPath$fEqFsErrorPath$fCondenseFsErrorPath$fShowFsErrorPath$fCondenseHandle $fShowHandle $fEqHandle$fNFDataHandle$fExceptionFsError $fShowFsError$fShowFsErrorType$fEqFsErrorType $fEqAbsOffset$fOrdAbsOffset$fEnumAbsOffset$fBoundedAbsOffset$fNumAbsOffset$fShowAbsOffset$fGenericHandle $fEqFsPath $fOrdFsPath$fGenericFsPath$fNFDataFsPath $fEqOpenMode$fShowOpenMode$fEqAllowExisting$fShowAllowExisting BufferOffsetunBufferOffset SomeHasFSHasFS dumpStatehClosehIsOpenhSeekhGetSome hGetSomeAthPutSome hTruncatehGetSizecreateDirectorycreateDirectoryIfMissing listDirectorydoesDirectoryExist doesFileExistremoveDirectoryRecursive removeFile renameFile mkFsErrorPathunsafeToFilePath hGetBufSome hGetBufSomeAt hPutBufSome hPutBufSomeAtwithFilehClose'hGetBufExactlyhGetBufExactlyAthPutBufExactlyhPutBufExactlyAt$fEqBufferOffset$fOrdBufferOffset$fEnumBufferOffset$fBoundedBufferOffset$fNumBufferOffset$fShowBufferOffset $fNFDataHasFS hPutAllStrict hGetExactly hGetExactlyAthGetAll hGetAllAthPutAllhPutCRCgetCRCinitCRC updateCRC computeCRC hPutAllCRChGetExactlyAtCRC hGetAllAtCRC$fEqCRC $fShowCRC $fGenericCRC $fStorableCRCHandleOSfilePathhandleisOpenHandleOS closeHandleOSwithOpenHandleisHandleClosedException$fShowHandleOS $fEqHandleOSFHandleopenwriteseekreadreadBufwriteBufpreadpreadBuf pwriteBuftruncateclosegetSizeHandleIOioHasFSGHC.ShowShowErrno GHC.MaybeNothingfilepath-1.4.100.4System.FilePath.PosixGHC.IOFilePathGHC.IO.ExceptionIOError IOErrorTypeData.Array.ByteMutableByteArrayGHC.IntInt64GHC.WordWord64ghc-prim GHC.TypesIOTruebytestring-0.11.5.2Data.ByteString.Internal.Type ByteStringData.ByteString.Lazy.Internal Data.ByteString.Builder.InternalBuilderGHC.MVarMVardefaultFileFlags