File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 2323 "purescript-foreign" : " ~0.4.0" ,
2424 "purescript-node-buffer" : " ~0.0.1" ,
2525 "purescript-node-path" : " ~0.2.0" ,
26- "purescript-datetime" : " ~0.3 .0" ,
26+ "purescript-datetime" : " ~0.4 .0" ,
2727 "purescript-exceptions" : " ~0.2.1"
2828 }
2929}
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import Control.Monad.Eff
2929import Control.Monad.Eff.Unsafe (unsafeInterleaveEff )
3030import Control.Monad.Eff.Exception
3131import Data.Date
32+ import Data.Time
3233import Data.Either
3334import Data.Function
3435import Data.Maybe
@@ -76,7 +77,7 @@ foreign import fs "var fs = require('fs');" ::
7677 , appendFile :: forall a opts . Fn4 FilePath a { | opts } (JSCallback Unit ) Unit
7778 , exists :: forall a . Fn2 FilePath (Boolean -> a ) Unit
7879 }
79-
80+
8081foreign import mkEff
8182 " function mkEff(action) {\
8283 \ return action;\
@@ -258,9 +259,11 @@ utimes :: forall eff. FilePath
258259
259260utimes file atime mtime cb = mkEff $ \_ -> runFn4
260261 fs.utimes file
261- ((toEpochMilliseconds atime) / 1000 )
262- ((toEpochMilliseconds mtime) / 1000 )
262+ (ms (toEpochMilliseconds atime) / 1000 )
263+ (ms (toEpochMilliseconds mtime) / 1000 )
263264 (handleCallback cb)
265+ where
266+ ms (Milliseconds n) = n
264267
265268-- |
266269-- 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
4141import Control.Monad.Eff
4242import Control.Monad.Eff.Exception
4343import Data.Date
44+ import Data.Time
4445import Data.Either
4546import Data.Function
4647import Data.Maybe (Maybe (..))
@@ -276,8 +277,10 @@ utimes :: forall eff. FilePath
276277
277278utimes file atime mtime = mkEff $ \_ -> runFn3
278279 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
281284
282285-- |
283286-- 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