move
Déplace un fichier ou un dossier.
Exemple
ts
import { SF } from "@duplojs/server-utils";
import { E } from "@duplojs/utils";
const result = await SF.move("/tmp/src", "/tmp/dest");
// result: E.Ok | SF.FileSystemLeft
if (E.isRight(result)) {
// element move with success
}
await SF.move("/tmp/file.txt", "/tmp/archive/file.txt");Syntaxe
typescript
function move(
fromPath: string | URL,
toPath: string | URL
): Promise<FileSystemLeft | E.Ok>Paramètres
fromPath: chemin source.toPath: chemin de destination.
Valeur de retour
E.Ok: si le déplacement réussit.FileSystemLeft: si le déplacement échoue.
Voir aussi
copy- Copie un fichier ou un dossier.
