You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -58,16 +58,16 @@ Our wasm file should be compiled to `target/wasm32-wasi/debug/wasi_hello_world.w
58
58
59
59
To do this, we can use the Wasmtime CLI, which we mentioned should be installed at the beginning of this tutorial. However, there is one thing to note that was mentioned in the code comments. **We need to give our program explicit access to create files on our host, because our program creates a new file**. As mentioned in the [WASI Introduction](/example-redirect?exampleName=wasi-introduction), our guest will not have this capability unless we give them the capability.
60
60
61
-
To grant the capability to write in a directory using the Wasmtime CLI, we need to use the `--mapdir` flag. `--mapdir` will allow us to map the `/helloworld` directory on the guest's virtual filesystem, to the current directory (`.`) on the host fileystem. For example:
61
+
To grant the capability to write in a directory using the Wasmtime CLI, we need to use the `--dir` flag. `--dir` will allow us to map the `/helloworld` directory on the guest's virtual filesystem, to the current directory (`.`) on the host fileystem. For example:
You should then see "Hello World!" logged in your terminal. You should also notice that a `helloworld.txt` file was created in your current directory, with the contents of "Hello World!".
@@ -58,16 +58,16 @@ O nosso arquivo wasm deveria ser compilado a `target/wasm32-wasi/debug/wasi_hell
58
58
59
59
Para isso, podemos usar a linha de comando do Wasmtime, que lhe pedimos para instalar no início deste tutorial. No entanto, há uma coisa a notar que foi mencionada nos comentários do programa. **Precisamos explicitamente dar ao nosso programa acesso à criação de arquivos no nosso host, pois o nosso programa cria um novo arquivo**. Como mencionado na [Introdução à WASI](/example-redirect?exampleName=wasi-introduction), o nosso guest não tem essa capacidade a menos que nós lhe demos tal capacidade.
60
60
61
-
Para autorizar o uso da capacidade de escrever em um diretório usando a linha de comando do Wasmtime, precisamos passar o parâmetro `--mapdir`. `--mapdir` nos permite mapear o diretório `/helloworld` no sistema de arquivos virtual do guest, ao diretório atual (`.`) no sistema de arquivos do host. Por exemplo:
61
+
Para autorizar o uso da capacidade de escrever em um diretório usando a linha de comando do Wasmtime, precisamos passar o parâmetro `--dir`. `--dir` nos permite mapear o diretório `/helloworld` no sistema de arquivos virtual do guest, ao diretório atual (`.`) no sistema de arquivos do host. Por exemplo:
Você deve então ver "Hello World!" escrito na tela do seu terminal. E também deve notar que um novo arquivo `helloworld.txt` apareceu no seu diretório atual, com o conteúdo "Hello World!".
0 commit comments