diff --git a/src/Client.ts b/src/Client.ts index 3579c0d..44ec567 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -372,6 +372,14 @@ export class Client { return this.send("RNTO " + validDest) } + /** + * Check a file if it exists or not + */ + async fileExists(path: string): Promise { + const validPath = await this.protectWhitespace(path) + return !!this.sendIgnoringError(`SIZE ${validPath}`); + } + /** * Remove a file from the current working directory. *