$file = '/path/to/myfile.txt'; $owner = \OC\Files\Filesystem::getOwner($file); echo "The owner of $file is $owner";
$folder = '/path/to/myfolder/'; $owner = \OC\Files\Filesystem::getOwner($folder); echo "The owner of $folder is $owner";This code retrieves the owner of the `myfolder` folder located at `/path/to/` and displays it in the console. The `getOwner` method is a part of the ownCloud PHP library and does not require any external packages or libraries.