summaryrefslogtreecommitdiff
path: root/std/fs
diff options
context:
space:
mode:
Diffstat (limited to 'std/fs')
-rw-r--r--std/fs/copy.ts8
-rw-r--r--std/fs/empty_dir.ts6
-rw-r--r--std/fs/walk.ts6
3 files changed, 10 insertions, 10 deletions
diff --git a/std/fs/copy.ts b/std/fs/copy.ts
index d442e46ae..609a8437b 100644
--- a/std/fs/copy.ts
+++ b/std/fs/copy.ts
@@ -109,7 +109,7 @@ async function copySymLink(
options: CopyOptions
): Promise<void> {
await ensureValidCopy(src, dest, options);
- const originSrcFilePath = await Deno.readlink(src);
+ const originSrcFilePath = await Deno.readLink(src);
const type = getFileInfoType(await Deno.lstat(src));
await Deno.symlink(originSrcFilePath, dest, type);
if (options.preserveTimestamps) {
@@ -127,7 +127,7 @@ function copySymlinkSync(
options: CopyOptions
): void {
ensureValidCopySync(src, dest, options);
- const originSrcFilePath = Deno.readlinkSync(src);
+ const originSrcFilePath = Deno.readLinkSync(src);
const type = getFileInfoType(Deno.lstatSync(src));
Deno.symlinkSync(originSrcFilePath, dest, type);
if (options.preserveTimestamps) {
@@ -157,7 +157,7 @@ async function copyDir(
await Deno.utime(dest, srcStatInfo.atime, srcStatInfo.mtime);
}
- for await (const entry of Deno.readdir(src)) {
+ for await (const entry of Deno.readDir(src)) {
const srcPath = path.join(src, entry.name);
const destPath = path.join(dest, path.basename(srcPath as string));
if (entry.isSymlink) {
@@ -185,7 +185,7 @@ function copyDirSync(src: string, dest: string, options: CopyOptions): void {
Deno.utimeSync(dest, srcStatInfo.atime, srcStatInfo.mtime);
}
- for (const entry of Deno.readdirSync(src)) {
+ for (const entry of Deno.readDirSync(src)) {
assert(entry.name != null, "file.name must be set");
const srcPath = path.join(src, entry.name);
const destPath = path.join(dest, path.basename(srcPath as string));
diff --git a/std/fs/empty_dir.ts b/std/fs/empty_dir.ts
index 5e860c65f..8c3083cee 100644
--- a/std/fs/empty_dir.ts
+++ b/std/fs/empty_dir.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { join } from "../path/mod.ts";
-const { readdir, readdirSync, mkdir, mkdirSync, remove, removeSync } = Deno;
+const { readDir, readDirSync, mkdir, mkdirSync, remove, removeSync } = Deno;
/**
* Ensures that a directory is empty.
* Deletes directory contents if the directory is not empty.
@@ -11,7 +11,7 @@ const { readdir, readdirSync, mkdir, mkdirSync, remove, removeSync } = Deno;
export async function emptyDir(dir: string): Promise<void> {
try {
const items = [];
- for await (const dirEntry of readdir(dir)) {
+ for await (const dirEntry of readDir(dir)) {
items.push(dirEntry);
}
@@ -41,7 +41,7 @@ export async function emptyDir(dir: string): Promise<void> {
*/
export function emptyDirSync(dir: string): void {
try {
- const items = [...readdirSync(dir)];
+ const items = [...readDirSync(dir)];
// if directory already exist. then remove it's child item.
while (items.length) {
diff --git a/std/fs/walk.ts b/std/fs/walk.ts
index a99d35a50..d01f35167 100644
--- a/std/fs/walk.ts
+++ b/std/fs/walk.ts
@@ -3,7 +3,7 @@
// Copyright 2009 The Go Authors. All rights reserved. BSD license.
import { unimplemented, assert } from "../testing/asserts.ts";
import { basename, join, normalize } from "../path/mod.ts";
-const { readdir, readdirSync, stat, statSync } = Deno;
+const { readDir, readDirSync, stat, statSync } = Deno;
export function createWalkEntrySync(path: string): WalkEntry {
path = normalize(path);
@@ -103,7 +103,7 @@ export async function* walk(
if (maxDepth < 1 || !include(root, undefined, undefined, skip)) {
return;
}
- for await (const entry of readdir(root)) {
+ for await (const entry of readDir(root)) {
if (entry.isSymlink) {
if (followSymlinks) {
// TODO(ry) Re-enable followSymlinks.
@@ -156,7 +156,7 @@ export function* walkSync(
if (maxDepth < 1 || !include(root, undefined, undefined, skip)) {
return;
}
- for (const entry of readdirSync(root)) {
+ for (const entry of readDirSync(root)) {
if (entry.isSymlink) {
if (followSymlinks) {
unimplemented();