Skip to content

setOwner

Definit le propriétaire d'un fichier ou dossier.

Exemple

ts
import { 
SF
} from "@duplojs/server-utils";
const
result
= await
SF
.
setOwner
("/tmp/file.txt", {
userId
: 1000,
groupId
: 1000,
}); // result: E.Ok | SF.FileSystemLeft await
SF
.
setOwner
("/tmp/app.log", {
userId
: 0,
groupId
: 0,
});

Syntaxe

typescript
function setOwner(
  path: string | URL,
  params: {
    userId: number;
    groupId: number;
  }
): Promise<FileSystemLeft | E.Ok>

Paramètres

  • path : chemin cible.
  • params.userId : identifiant utilisateur.
  • params.groupId : identifiant groupe.

Valeur de retour

  • E.Ok : si l'opération réussit.
  • FileSystemLeft : si l'opération échoue.

Voir aussi

  • setMode - Definit les permissions d'un fichier ou dossier.

Diffusé sous licence MIT.