utimes
Set the access and modification times of a file (atime, mtime). Current Vooya FS inputs are numbers in seconds since the Unix epoch.
Basic usage
import { utimes } from '@vooya/fs'
await utimes('./file.txt', atime, mtime)Methods
utimes(path, atime, mtime)
Async. Returns Promise<void>.
| Argument | Type | Description |
|---|---|---|
path | string | File path. |
atime | number | Access time (e.g. seconds since epoch). |
mtime | number | Modification time. |
utimesSync(path, atime, mtime)
Sync. Same arguments; throws on error.
Performance
Single syscall; on par with Node.js. See Benchmarks.
Notes
- Precision: Platform-dependent; same as Node.js.
- Known gap: Missing-path errors currently have Node-like messages, but do not expose Node-style
code,path, andsyscallfields yet. - Unsupported Node inputs/APIs:
Bufferpaths,URLpaths,Datetime values, string time values, and file-descriptorfutimesAPIs are not part of the current Vooya FSutimessurface.
Competitor measurements
See the full utimes comparison table for Node 22/24, peer libraries, sync/Promise modes, small and batch workloads, execution routes and measurement limits.
Last updated on