@poe-platform/safe-fs 0.1.822 → 0.1.824

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -359,6 +359,37 @@ export function createPythonNativeSyscalls(options) {
359
359
  await request(name === '__syscall_chmod' ? 'chmod' : 'truncate', path, second);
360
360
  return 0;
361
361
  }
362
+ case '__syscall_utimensat': {
363
+ if (fourth !== 0)
364
+ fail('ENOTSUP');
365
+ const path = pathAt(first, second);
366
+ if (privatePath(path))
367
+ fail('EROFS');
368
+ if (third)
369
+ range(third, 32);
370
+ const now = Date.now();
371
+ const timestamp = (offset) => {
372
+ if (!third)
373
+ return now;
374
+ const nanos = view().getInt32(third + offset + 8, true);
375
+ if (nanos === 1073741823)
376
+ return now;
377
+ if (nanos === 1073741822)
378
+ return null;
379
+ if (nanos < 0 || nanos >= 1000000000)
380
+ fail('EINVAL');
381
+ const value = integer(view().getBigInt64(third + offset, true)) * 1000 + nanos / 1000000;
382
+ if (Math.abs(value) > Number.MAX_SAFE_INTEGER)
383
+ fail('EOVERFLOW');
384
+ return value;
385
+ };
386
+ const atime = timestamp(0), mtime = timestamp(16);
387
+ if (atime === null && mtime === null)
388
+ return 0;
389
+ const previous = atime === null || mtime === null ? await request('stat', path) : undefined;
390
+ await request('utimes', path, atime ?? previous.atimeMs, mtime ?? previous.mtimeMs);
391
+ return 0;
392
+ }
362
393
  case '__syscall_renameat': {
363
394
  const source = pathAt(first, second);
364
395
  const destination = pathAt(third, fourth);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poe-platform/safe-fs",
3
- "version": "0.1.822",
3
+ "version": "0.1.824",
4
4
  "description": "Composable filesystem with a portable core and explicit Node adapters",
5
5
  "type": "module",
6
6
  "license": "MIT",