@@ -381,7 +381,12 @@ setFileTimes name atime mtime = do
381
381
-- - HFS+ volumes on OS X truncate the sub-second part of the timestamp.
382
382
--
383
383
setFileTimesHiRes :: RawFilePath -> POSIXTime -> POSIXTime -> IO ()
384
- #ifdef HAVE_UTIMENSAT
384
+ #if defined(javascript_HOST_ARCH)
385
+ setFileTimesHiRes name atime mtime =
386
+ withFilePath name $ \ s ->
387
+ throwErrnoPathIfMinus1_ " setFileTimesHiRes" name $
388
+ js_utimes s (realToFrac atime) (realToFrac mtime)
389
+ #elif defined(HAVE_UTIMENSAT)
385
390
setFileTimesHiRes name atime mtime =
386
391
withFilePath name $ \ s ->
387
392
withArray [toCTimeSpec atime, toCTimeSpec mtime] $ \ times ->
@@ -404,7 +409,12 @@ setFileTimesHiRes name atime mtime =
404
409
-- - HFS+ volumes on OS X truncate the sub-second part of the timestamp.
405
410
--
406
411
setSymbolicLinkTimesHiRes :: RawFilePath -> POSIXTime -> POSIXTime -> IO ()
407
- #if HAVE_UTIMENSAT
412
+ #if defined(javascript_HOST_ARCH)
413
+ setSymbolicLinkTimesHiRes name atime mtime =
414
+ withFilePath name $ \ s ->
415
+ throwErrnoPathIfMinus1_ " setSymbolicLinkTimesHiRes" name $
416
+ js_lutimes s (realToFrac atime) (realToFrac mtime)
417
+ #elif HAVE_UTIMENSAT
408
418
setSymbolicLinkTimesHiRes name atime mtime =
409
419
withFilePath name $ \ s ->
410
420
withArray [toCTimeSpec atime, toCTimeSpec mtime] $ \ times ->
@@ -437,7 +447,11 @@ touchFile name = do
437
447
--
438
448
-- Note: calls @lutimes@.
439
449
touchSymbolicLink :: RawFilePath -> IO ()
440
- #if HAVE_LUTIMES
450
+ #if defined(javascript_HOST_ARCH)
451
+ touchSymbolicLink name =
452
+ withFilePath name $ \ s ->
453
+ throwErrnoPathIfMinus1_ " touchSymbolicLink" name (js_lutimes s (- 1 ) (- 1 ))
454
+ #elif HAVE_LUTIMES
441
455
touchSymbolicLink name =
442
456
withFilePath name $ \ s ->
443
457
throwErrnoPathIfMinus1_ " touchSymbolicLink" name (c_lutimes s nullPtr)
0 commit comments