Skip to content

Commit 0572688

Browse files
committed
Restructure examples
1 parent 9ec740b commit 0572688

File tree

9 files changed

+28
-27
lines changed

9 files changed

+28
-27
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

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

examples/fatfs/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/fatfs/README.md

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

examples/fatfs/src/fatfs/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 = "fatfs-example"
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.

0 commit comments

Comments
 (0)