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

Function sftpReadFile

packages/kaos/src/ssh.ts:382–392  ·  view source on GitHub ↗
(sftp: SFTPWrapper, path: string)

Source from the content-addressed store, hash-verified

380}
381
382function sftpReadFile(sftp: SFTPWrapper, path: string): Promise<Buffer> {
383 return new Promise<Buffer>((resolve, reject) => {
384 sftp.readFile(path, (err, data) => {
385 if (err) {
386 reject(mapSftpError('readFile', err));
387 } else {
388 resolve(data);
389 }
390 });
391 });
392}
393
394function sftpWriteFile(sftp: SFTPWrapper, path: string, data: string | Buffer): Promise<void> {
395 return new Promise<void>((resolve, reject) => {

Callers 2

readBytesMethod · 0.85
readTextMethod · 0.85

Calls 4

rejectFunction · 0.85
mapSftpErrorFunction · 0.85
readFileMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected