MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / sftpWriteFile

Function sftpWriteFile

packages/kaos/src/ssh.ts:394–404  ·  view source on GitHub ↗
(sftp: SFTPWrapper, path: string, data: string | Buffer)

Source from the content-addressed store, hash-verified

392}
393
394function sftpWriteFile(sftp: SFTPWrapper, path: string, data: string | Buffer): Promise<void> {
395 return new Promise<void>((resolve, reject) => {
396 sftp.writeFile(path, data, (err) => {
397 if (err) {
398 reject(mapSftpError('writeFile', err));
399 } else {
400 resolve();
401 }
402 });
403 });
404}
405
406function sftpAppendFile(sftp: SFTPWrapper, path: string, data: string | Buffer): Promise<void> {
407 return new Promise<void>((resolve, reject) => {

Callers 2

writeBytesMethod · 0.85
writeTextMethod · 0.85

Calls 3

rejectFunction · 0.85
mapSftpErrorFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected