Readonly[toReadonlypathFile path (passed during creation)
Change file permissions (e.g., 0o644)
Change file owner and group
Close file (force release resource)
Sync file data to disk (excluding metadata)
Get underlying file descriptor (for debugging)
Read data from file (async)
Buffer to write data into (will be modified)
Optionalposition: number | nullFile read position, null means current offset
Actual bytes read, 0 indicates EOF
Get file metadata (async)
Sync file data to disk (including metadata)
Truncate file to specified size
Optionaloffset: numberChange file access and modification times
Write data to file (async)
Data to write
Optionalposition: number | nullFile write position, null means current offset
Actual bytes written
File handle object (based on file descriptor)
Warning
Resource management warning:
close()explicitly, otherwise file descriptor will leak