File tree 3 files changed +12
-6
lines changed
3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 23
23
"purescript-foreign" : " ~0.4.0" ,
24
24
"purescript-node-buffer" : " ~0.0.1" ,
25
25
"purescript-node-path" : " ~0.2.0" ,
26
- "purescript-datetime" : " ~0.3 .0" ,
26
+ "purescript-datetime" : " ~0.4 .0" ,
27
27
"purescript-exceptions" : " ~0.2.1"
28
28
}
29
29
}
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import Control.Monad.Eff
29
29
import Control.Monad.Eff.Unsafe (unsafeInterleaveEff )
30
30
import Control.Monad.Eff.Exception
31
31
import Data.Date
32
+ import Data.Time
32
33
import Data.Either
33
34
import Data.Function
34
35
import Data.Maybe
@@ -76,7 +77,7 @@ foreign import fs "var fs = require('fs');" ::
76
77
, appendFile :: forall a opts . Fn4 FilePath a { | opts } (JSCallback Unit ) Unit
77
78
, exists :: forall a . Fn2 FilePath (Boolean -> a ) Unit
78
79
}
79
-
80
+
80
81
foreign import mkEff
81
82
" function mkEff(action) {\
82
83
\ return action;\
@@ -258,9 +259,11 @@ utimes :: forall eff. FilePath
258
259
259
260
utimes file atime mtime cb = mkEff $ \_ -> runFn4
260
261
fs.utimes file
261
- ((toEpochMilliseconds atime) / 1000 )
262
- ((toEpochMilliseconds mtime) / 1000 )
262
+ (ms (toEpochMilliseconds atime) / 1000 )
263
+ (ms (toEpochMilliseconds mtime) / 1000 )
263
264
(handleCallback cb)
265
+ where
266
+ ms (Milliseconds n) = n
264
267
265
268
-- |
266
269
-- Reads the entire contents of a file returning the result as a raw buffer.
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ module Node.FS.Sync
41
41
import Control.Monad.Eff
42
42
import Control.Monad.Eff.Exception
43
43
import Data.Date
44
+ import Data.Time
44
45
import Data.Either
45
46
import Data.Function
46
47
import Data.Maybe (Maybe (..))
@@ -276,8 +277,10 @@ utimes :: forall eff. FilePath
276
277
277
278
utimes file atime mtime = mkEff $ \_ -> runFn3
278
279
fs.utimesSync file
279
- ((toEpochMilliseconds atime) / 1000 )
280
- ((toEpochMilliseconds mtime) / 1000 )
280
+ (ms (toEpochMilliseconds atime) / 1000 )
281
+ (ms (toEpochMilliseconds mtime) / 1000 )
282
+ where
283
+ ms (Milliseconds n) = n
281
284
282
285
-- |
283
286
-- Reads the entire contents of a file returning the result as a raw buffer.
You can’t perform that action at this time.
0 commit comments