MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / writeFile

Method writeFile

src/fileSystem/ftp.js:142–158  ·  view source on GitHub ↗

* Write file to ftp server * @param {string|ArrayBuffer} content * @returns

(content = "")

Source from the content-addressed store, hash-verified

140 * @returns
141 */
142 async writeFile(content = "") {
143 await this.#connectIfNotConnected();
144 const localFile = this.#cacheFile;
145 await internalFs.writeFile(localFile, content, true, false);
146
147 return new Promise((resolve, reject) => {
148 ftp.uploadFile(
149 this.#conId,
150 this.#cacheFile,
151 this.#path,
152 () => {
153 resolve(Url.join(this.#origin, this.#path));
154 },
155 reject,
156 );
157 });
158 }
159
160 async createFile(name, content = "") {
161 await this.#connectIfNotConnected();

Callers 15

updateFunction · 0.45
addSftpFunction · 0.45
sendFileFunction · 0.45
LoggerClass · 0.45
editorFile.jsFile · 0.45
saveFileFunction · 0.45
processFileFunction · 0.45
#saveMethod · 0.45
saveMethod · 0.45
clearMethod · 0.45
resetKeyBindingsFunction · 0.45
runFsTestsFunction · 0.45

Calls 3

resolveFunction · 0.85
uploadFileMethod · 0.65

Tested by

no test coverage detected