Skip to content

Commit

Permalink
Support single partition mode, fix issue related to memory growth, im…
Browse files Browse the repository at this point in the history
…prove documentation, fix Typescript definitions when importing.
  • Loading branch information
ParkerTomatoes committed Dec 1, 2024
1 parent fa8ebf7 commit b3504de
Show file tree
Hide file tree
Showing 28 changed files with 1,599 additions and 233 deletions.
23 changes: 22 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fatfs-wasm / [Exports](modules.md)

# FatFs-Wasm
FatFs is a generic FAT/exFAT filesystem module for small embedded systems, authored by CHaN. FatFS-Wasm is a library which uses a WebAssembly build of FatFs to manipulate FAT image files from node or the browser.
FatFs is a generic FAT/exFAT filesystem module for small embedded systems, authored by CHaN. FatFs-Wasm is a library which uses a WebAssembly build of FatFs to manipulate FAT image files from node or the browser.

Features:
* Read, write, rename, stat, chmod, and delete files
Expand Down Expand Up @@ -68,3 +68,24 @@ for (const file of dir) {
}
dir.close();
```

See the API documentation for details

## API Documentation

[API Documentation](./docs/modules.md)

## Modifying FatFs C Code
FatFs has many feature gates defined using the preprocessor. See `native/ff15/source/ffconf.h` to make adjustments. Please note that any changes to the C code must be reflected in the `src/fatfs.ts`` wrapper, which is not automatically generated. Make changes at your own risk!

To build, open a terminal in MacOS, Linux, or WSL with clang installed and run the build script:
```
cd native
./build.sh
```
This will build `ff.wasm` and copy it to the `src` directory.

## Running Tests
```
npx jest
```
50 changes: 43 additions & 7 deletions docs/classes/FatFsDir.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ FatFs Directory Reference

- [constructor](FatFsDir.md#constructor)

### Properties

- [#context](FatFsDir.md##context)
- [#dirPtr](FatFsDir.md##dirptr)
- [#exports](FatFsDir.md##exports)

### Accessors

- [dp](FatFsDir.md#dp)
Expand Down Expand Up @@ -38,7 +44,37 @@ FatFs Directory Reference

#### Defined in

src/fatfs.ts:610
[src/fatfs.ts:665](https://github.com/parkertomatoes/fatfs-wasm/blob/fa8ebf7/src/fatfs.ts#L665)

## Properties

### #context

`Private` **#context**: `FatFsMemoryContext`

#### Defined in

[src/fatfs.ts:663](https://github.com/parkertomatoes/fatfs-wasm/blob/fa8ebf7/src/fatfs.ts#L663)

___

### #dirPtr

`Private` **#dirPtr**: `number`

#### Defined in

[src/fatfs.ts:661](https://github.com/parkertomatoes/fatfs-wasm/blob/fa8ebf7/src/fatfs.ts#L661)

___

### #exports

`Private` **#exports**: `FatFsExports`

#### Defined in

[src/fatfs.ts:662](https://github.com/parkertomatoes/fatfs-wasm/blob/fa8ebf7/src/fatfs.ts#L662)

## Accessors

Expand All @@ -52,7 +88,7 @@ src/fatfs.ts:610

#### Defined in

src/fatfs.ts:616
[src/fatfs.ts:671](https://github.com/parkertomatoes/fatfs-wasm/blob/fa8ebf7/src/fatfs.ts#L671)

## Methods

Expand All @@ -66,7 +102,7 @@ src/fatfs.ts:616

#### Defined in

src/fatfs.ts:672
[src/fatfs.ts:727](https://github.com/parkertomatoes/fatfs-wasm/blob/fa8ebf7/src/fatfs.ts#L727)

___

Expand All @@ -82,7 +118,7 @@ Closes the open directory.

#### Defined in

src/fatfs.ts:623
[src/fatfs.ts:678](https://github.com/parkertomatoes/fatfs-wasm/blob/fa8ebf7/src/fatfs.ts#L678)

___

Expand All @@ -98,7 +134,7 @@ The f_findnext function searches for a next matched object

#### Defined in

src/fatfs.ts:660
[src/fatfs.ts:715](https://github.com/parkertomatoes/fatfs-wasm/blob/fa8ebf7/src/fatfs.ts#L715)

___

Expand All @@ -116,7 +152,7 @@ Information about the next directory entry

#### Defined in

src/fatfs.ts:635
[src/fatfs.ts:690](https://github.com/parkertomatoes/fatfs-wasm/blob/fa8ebf7/src/fatfs.ts#L690)

___

Expand All @@ -132,4 +168,4 @@ Rewinds the directory

#### Defined in

src/fatfs.ts:650
[src/fatfs.ts:705](https://github.com/parkertomatoes/fatfs-wasm/blob/fa8ebf7/src/fatfs.ts#L705)
Loading

0 comments on commit b3504de

Please sign in to comment.