summaryrefslogtreecommitdiff
path: root/cli/js/utime.ts
diff options
context:
space:
mode:
authordubiousjim <dubiousjim@gmail.com>2020-03-06 11:29:23 -0500
committerGitHub <noreply@github.com>2020-03-06 11:29:23 -0500
commitacf0958e940f8c668c9f34dc780da48d8963a1e7 (patch)
tree69816ce683e0b369e2c7b6566cc249255a39953d /cli/js/utime.ts
parentbb3d9c8280912f6e30692477aeb5331fb359d993 (diff)
Rename name/filename arguments to path (#4227)
There's a lot of variation in doc comments and internal code about whether the first parameter to file system calls is `path` or `name` or `filename`. For consistency, have made it always be `path`.
Diffstat (limited to 'cli/js/utime.ts')
-rw-r--r--cli/js/utime.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/cli/js/utime.ts b/cli/js/utime.ts
index 102e5f359..2026e60bf 100644
--- a/cli/js/utime.ts
+++ b/cli/js/utime.ts
@@ -8,19 +8,19 @@ function toSecondsFromEpoch(v: number | Date): number {
/** **UNSTABLE**: needs investigation into high precision time.
*
* Synchronously changes the access and modification times of a file system
- * object referenced by `filename`. Given times are either in seconds
- * (Unix epoch time) or as `Date` objects.
+ * object referenced by `path`. Given times are either in seconds (UNIX epoch
+ * time) or as `Date` objects.
*
* Deno.utimeSync("myfile.txt", 1556495550, new Date());
*
* Requires `allow-write` permission. */
export function utimeSync(
- filename: string,
+ path: string,
atime: number | Date,
mtime: number | Date
): void {
sendSync("op_utime", {
- filename,
+ path,
// TODO(ry) split atime, mtime into [seconds, nanoseconds] tuple
atime: toSecondsFromEpoch(atime),
mtime: toSecondsFromEpoch(mtime)
@@ -30,19 +30,19 @@ export function utimeSync(
/** **UNSTABLE**: needs investigation into high precision time.
*
* Changes the access and modification times of a file system object
- * referenced by `filename`. Given times are either in seconds
- * (Unix epoch time) or as `Date` objects.
+ * referenced by `path`. Given times are either in seconds (UNIX epoch time)
+ * or as `Date` objects.
*
* await Deno.utime("myfile.txt", 1556495550, new Date());
*
* Requires `allow-write` permission. */
export async function utime(
- filename: string,
+ path: string,
atime: number | Date,
mtime: number | Date
): Promise<void> {
await sendAsync("op_utime", {
- filename,
+ path,
// TODO(ry) split atime, mtime into [seconds, nanoseconds] tuple
atime: toSecondsFromEpoch(atime),
mtime: toSecondsFromEpoch(mtime)