<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## Call type:呼叫類型: `require("Storage").write(name,data,offset,size)` ## 參數 `name` - 文件名 - 最多 28 個字符(區分大小寫) `data` - 要寫入的數據 `offset` - [可選] 文件中要寫入的偏移量(如果`0`創建了新文件,`undefined`否則 Espruino 會嘗試在現有文件中寫入(如果存在) `size` - [可選] 文件的大小(如果要創建的文件大于數據) ## 返回 成功為真,失敗為假 ## 描述 在閃存區域中寫入/創建文件。這是非易失性的,當設備復位或斷電時不會消失。 簡單地寫 `require("Storage").write("MyFile","Some data")` 來寫入一個新文件,以及`require("Storage").read("MyFile")`來讀取它。 如果您提供: * 一個字符串,它將按原樣被寫入。 * 一個數組,將被作為一個字節數組寫入(但讀取回來時是作為一個字符串)。 * 一個對象,在被寫入之前它將自動被轉換為一個 JSON 字符串。 **注意**:如果提供了一個數組,它將不會被轉換為 JSON。為了明確這種轉換,你可以使用 [Storage.writeJSON](writeJSON.md) 你也可以創建一個文件然后稍后填充數據**只要你不嘗試覆蓋已經存在的數據**。例如: ~~~ var f = require("Storage"); f.write("a","Hello",0,14); // Creates a new file, 14 chars long print(JSON.stringify(f.read("a"))); // read the file // any nonwritten chars will be char code 255: "Hello\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF\u00FF" f.write("a"," ",5); // write within the file f.write("a","World!!!",6); // write again within the file print(f.read("a")); // "Hello World!!!" f.write("a"," ",0); // Writing to location 0 again will cause the file to be re-written print(f.read("a")); // " " ~~~ 如果要寫入的數據多于可用 RAM,則此方法非常有用 - 例如,Web IDE 使用此方法將大文件寫入板載存儲。 **注意:** 這個函數應該用于普通文件,而不是用`require("Storage").open(文件名,...)` 創建的 [StorageFile](../StorageFile.md)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看