From f24938d9fd6ed5397713930c8743d8027c9886c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villafa=C3=B1ez?= Date: Thu, 24 Jul 2014 17:03:16 +0200 Subject: [PATCH] Add support to get extended attributes for the files --- src/NativeShare.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/NativeShare.php b/src/NativeShare.php index 57180c3..3fb4687 100644 --- a/src/NativeShare.php +++ b/src/NativeShare.php @@ -316,4 +316,33 @@ class NativeShare implements IShare { )); return fopen('nativesmb://dummy', 'w', false, $context); } + + /** + * List the available extended attributes for the path (returns a fixed list) + * + * @param string $path + * @return array list the available attributes for the path + */ + public function listxattr($path) { + $this->connect(); + self::registerErrorHandler(); + $result = smbclient_listxattr($this->state, $this->buildUrl($path)); + self::restoreErrorHandler(); + return $result; + } + + /** + * Get extended attributes for the path + * + * @param string $path + * @param string $attr attribute to get the info + * @return string the attribute value + */ + public function getxattr($path, $attr) { + $this->connect(); + self::registerErrorHandler(); + $result = smbclient_getxattr($this->state, $this->buildUrl($path), $attr); + self::restoreErrorHandler(); + return $result; + } }