Skip to content

Commit 4f7df24

Browse files
authored
Merge pull request #9 from paulyoung/fatfs-example
Restructure examples
2 parents ebad618 + 5e03585 commit 4f7df24

File tree

10 files changed

+41
-40
lines changed

10 files changed

+41
-40
lines changed

Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace]
22
members = [
33
"src/icfs",
4-
"examples/fat/src/fat",
5-
]
4+
"examples/src/fatfs",
5+
]

examples/fat/dfx.json renamed to dfx.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"version": 1,
33
"dfx": "0.8.4",
44
"canisters": {
5-
"fat": {
5+
"fatfs": {
66
"type": "rust",
7-
"package": "fat",
8-
"candid": "src/fat/fat.did"
7+
"package": "fatfs_example",
8+
"candid": "examples/src/fatfs/fatfs.did"
99
}
1010
},
1111
"networks": {

examples/fat/README.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/fat/src/fat/Cargo.toml renamed to examples/src/fatfs/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "fat"
2+
name = "fatfs_example"
33
version = "0.1.0"
44
edition = "2018"
55

@@ -14,5 +14,5 @@ fatfs = { git = "https://github.com/rafalh/rust-fatfs", rev = "87fc1ed5074a32b4e
1414
fscommon = "0.1"
1515
ic-cdk = { git = "https://github.com/dfinity/cdk-rs.git", rev = "a253119adb08929b6304d007ee0a6a37960656ed" }
1616
ic-cdk-macros = "0.3"
17-
icfs = { path = "../../../../src/icfs" }
17+
icfs = { path = "../../../src/icfs" }
1818
time = "0.3"

examples/src/fatfs/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# fatfs example
2+
3+
```
4+
dfx start --clean
5+
```
6+
7+
```
8+
dfx deploy
9+
10+
dfx canister call fatfs ls
11+
dfx canister call fatfs write_file '("hello.txt", "Hello, World!")'
12+
dfx canister call fatfs ls
13+
dfx canister call fatfs read_file '("hello.txt")'
14+
15+
dfx canister call fatfs write_file '("hello.txt", "Hello!")'
16+
dfx canister call fatfs read_file '("hello.txt")'
17+
18+
dfx canister call fatfs write_file '("goodbye.txt", "Goodbye!")'
19+
dfx canister call fatfs ls
20+
dfx canister call fatfs read_file '("goodbye.txt")'
21+
```
File renamed without changes.
File renamed without changes.

flake.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@
9292
packages.all = pkgs.runCommand "all" {
9393
buildInputs = [
9494
packages.icfs
95-
packages.fat
95+
packages.fatfs-example
9696
];
9797
} ''
9898
touch $out
9999
'';
100100

101101
packages.icfs = buildRustPackage "icfs";
102-
packages.fat = buildRustPackage "fat";
102+
packages.fatfs-example = buildRustPackage "fatfs_example";
103103

104104
# `nix develop`
105105
devShell = pkgs.mkShell {

0 commit comments

Comments
 (0)