From Wiki96
Jump to: navigation, search
(Started this page)
 
m (Spelling: Primise -> Promise)
Line 19: Line 19:
Get the next available drive letter.
Get the next available drive letter.


=== <code>toBlob(path: String): Primise<Blob></code> ===
=== <code>toBlob(path: String): Promise<Blob></code> ===
Creates a blob from a specified path.
Creates a blob from a specified path.


Line 25: Line 25:
Retuns a file system by its prefix.
Retuns a file system by its prefix.


=== <code>toURL(path: String): Primise<String></code> ===
=== <code>toURL(path: String): Promise<String></code> ===
Creates a URL from the specified file path.
Creates a URL from the specified file path.


=== <code>isFile(path: String): Primise<Boolean></code> ===
=== <code>isFile(path: String): Promise<Boolean></code> ===
Returns <code>true</code> if the entry is a file.
Returns <code>true</code> if the entry is a file.


=== <code>isEmpty(path: String): Primise<Boolean></code> ===
=== <code>isEmpty(path: String): Promise<Boolean></code> ===
Returns <code>true</code> if the file is empty.
Returns <code>true</code> if the file is empty.


=== <code>mkdir(path: String): Primise<Boolean></code> ===
=== <code>mkdir(path: String): Promise<Boolean></code> ===
Creates a directory at the specified path.
Creates a directory at the specified path.


=== <code>rmdir(path: String): Primise<Boolean></code> ===
=== <code>rmdir(path: String): Promise<Boolean></code> ===
Deletes a directory at the specified path.
Deletes a directory at the specified path.


=== <code>touch(path: String): Primise<Boolean></code> ===
=== <code>touch(path: String): Promise<Boolean></code> ===
Creates a file at the specified path.
Creates a file at the specified path.


=== <code>rm(path: String): Primise<Boolean></code> ===
=== <code>rm(path: String): Promise<Boolean></code> ===
Deletes a file at the specified path.
Deletes a file at the specified path.



Revision as of 00:59, 23 March 2023

class FS

This namespace refers to the file system API of Windows 96. w96.FS allows manipulation of file system entries by, for example, renaming, deleting or copying them. It is also possible to create, read and write files and directories.

Structure

mount(fso: IFileSystem): Promise<void>

Mounts a file system using the specified object ("driver").

umount(prefix: String): Promise<void>

Unmounts a file system instance.

mounts(): IFileSystem[]

Gets all mounted file systems.

list(): String[]

Gets all mounted file system prefixes.

nextLetter(): String

Get the next available drive letter.

toBlob(path: String): Promise<Blob>

Creates a blob from a specified path.

get(prefix: String): IFileSystem

Retuns a file system by its prefix.

toURL(path: String): Promise<String>

Creates a URL from the specified file path.

isFile(path: String): Promise<Boolean>

Returns true if the entry is a file.

isEmpty(path: String): Promise<Boolean>

Returns true if the file is empty.

mkdir(path: String): Promise<Boolean>

Creates a directory at the specified path.

rmdir(path: String): Promise<Boolean>

Deletes a directory at the specified path.

touch(path: String): Promise<Boolean>

Creates a file at the specified path.

rm(path: String): Promise<Boolean>

Deletes a file at the specified path.

readdir(path: String): String[]

Returns a list of entities contained in the specified path.

cpdir(src: String, dest: String): Promise<Boolean>

Copies a directory to a new destination.

cpfile(src: String, dest: String): Promise<Boolean>

Copies a file to a new destination.

mvfile(src: String, dest: String): Promise<Boolean>

Moves a file to a new destination.

mvdir(src: String, dest: String): Promise<Boolean>

Moves a directory to a new destination.

exists(path: String): Boolean

Checks if an entity exists.

readstr(path: String): Promise<String>

Reads the specified file as a string.

readbin(path: String): Promise<Uint8Array>

Reads the specified file as binary.

filetype(path: String): 0 | 1 | -1

Returns the file type of a node. This can be a binary or text file.

writestr(path: String, data: String): Promise<Boolean>

Truncates and writes a UTF-8 encoded string to the specified file.

writebin(path: String, data: Uint8Array | Number[]): Promise<Boolean>

Truncates and writes data to the specified file.

walk(path: String): String[]

Walks through the contents of a directory.

stat(path: String): FSStatResult

Retrieves information about a file system entry.

rename(path: String, newName: String): Promise<Boolean>

Renames a file or folder.

readBinChunk()

readStrChunk()

cache()

uncache()

getFromCache()

hash(path: String, algorithm: "default" | "md5" | "sha256" | "sha512"): Promise<String>

Create a hash from a given path and algorithm.

assert()