2020-03-12 10:12:27 -04:00
|
|
|
import { notImplemented } from "../_utils.ts";
|
2020-03-03 08:56:10 -05:00
|
|
|
|
|
|
|
export default class Dirent {
|
2020-04-16 01:40:30 -04:00
|
|
|
constructor(private entry: Deno.DirEntry) {}
|
2020-03-03 08:56:10 -05:00
|
|
|
|
|
|
|
isBlockDevice(): boolean {
|
2020-04-29 16:00:31 -04:00
|
|
|
notImplemented("Deno does not yet support identification of block devices");
|
|
|
|
return false;
|
2020-03-03 08:56:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
isCharacterDevice(): boolean {
|
2020-04-29 16:00:31 -04:00
|
|
|
notImplemented(
|
|
|
|
"Deno does not yet support identification of character devices"
|
|
|
|
);
|
|
|
|
return false;
|
2020-03-03 08:56:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
isDirectory(): boolean {
|
2020-04-16 01:40:30 -04:00
|
|
|
return this.entry.isDirectory;
|
2020-03-03 08:56:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
isFIFO(): boolean {
|
|
|
|
notImplemented(
|
|
|
|
"Deno does not yet support identification of FIFO named pipes"
|
|
|
|
);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
isFile(): boolean {
|
2020-04-16 01:40:30 -04:00
|
|
|
return this.entry.isFile;
|
2020-03-03 08:56:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
isSocket(): boolean {
|
|
|
|
notImplemented("Deno does not yet support identification of sockets");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
isSymbolicLink(): boolean {
|
2020-04-16 01:40:30 -04:00
|
|
|
return this.entry.isSymlink;
|
2020-03-03 08:56:10 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
get name(): string | null {
|
|
|
|
return this.entry.name;
|
|
|
|
}
|
|
|
|
}
|