-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathFS.purs
More file actions
41 lines (33 loc) Β· 948 Bytes
/
FS.purs
File metadata and controls
41 lines (33 loc) Β· 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module Node.FS
( FileDescriptor
, FileMode
, SymlinkType(..)
, symlinkTypeToNode
, BufferLength
, BufferOffset
, ByteCount
, FilePosition
, module Exports
) where
import Prelude
import Node.FS.Constants (FileFlags(..), fileFlagsToNode) as Exports
foreign import data FileDescriptor :: Type
type FileMode = Int
type FilePosition = Int
type BufferLength = Int
type BufferOffset = Int
type ByteCount = Int
-- | Symlink varieties.
data SymlinkType = FileLink | DirLink | JunctionLink
-- | Convert a `SymlinkType` to a `String` in the format expected by the
-- | Node.js filesystem API.
symlinkTypeToNode :: SymlinkType -> String
symlinkTypeToNode ty = case ty of
FileLink -> "file"
DirLink -> "dir"
JunctionLink -> "junction"
instance showSymlinkType :: Show SymlinkType where
show FileLink = "FileLink"
show DirLink = "DirLink"
show JunctionLink = "JunctionLink"
derive instance eqSymlinkType :: Eq SymlinkType