Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions system/include/emscripten/wasmfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ backend_t wasmfs_get_backend_by_path(const char* path __attribute__((nonnull)));
// Obtains the backend_t of a specified fd.
backend_t wasmfs_get_backend_by_fd(int fd);

// Creates and opens a new file in the new file system under a specific backend.
// Creates and opens a new file using a specific backend.
// Returns the file descriptor for the new file like `open`. Returns a negative
// value on error. TODO: It might be worth returning a more specialized type
// like __wasi_fd_t here.
// TODO: Remove this function so that only directories can be mounted.
int wasmfs_create_file(const char* pathname __attribute__((nonnull)), mode_t mode, backend_t backend);

// Creates a new directory in the new file system under a specific backend.
// Creates a new directory using a specific backend.
// Returns 0 on success like `mkdir`, or a negative value on error.
// TODO: Add an alias with wasmfs_mount.
int wasmfs_create_directory(const char* path __attribute__((nonnull)), mode_t mode, backend_t backend);
Expand All @@ -40,7 +40,7 @@ int wasmfs_unmount(const char* path __attribute__((nonnull)));

// Backend creation

// Creates a JSFile Backend in the new file system.
// Creates a new JSFile Backend
backend_t wasmfs_create_js_file_backend(void);

// A function that receives a void* and returns a backend.
Expand Down Expand Up @@ -91,7 +91,7 @@ backend_t wasmfs_create_node_backend(const char* root __attribute__((nonnull)));
// thread.
backend_t wasmfs_create_opfs_backend(void);

// Creates a generic JSIMPL backend in the new file system.
// Creates a generic JSIMPL backend
backend_t wasmfs_create_jsimpl_backend(void);

backend_t wasmfs_create_icase_backend(backend_t backend);
Expand Down
8 changes: 4 additions & 4 deletions system/lib/wasmfs/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#include "file.h"

namespace wasmfs {
// A backend (or modular backend) provides a base for the new file system to
// extend its storage capabilities. Files and directories will be represented
// in the file system structure, but their underlying backing could exist in
// persistent storage, another thread, etc.
// A backend (or modular backend) provides a base to extend WasmFS with new
// storage capabilities. Files and directories will be represented in the file
// system structure, but their underlying backing could exist in persistent
// storage, another thread, etc.
class Backend {

public:
Expand Down