public function metadata($path)
    {
        $writeBinn= new BinnList;

        $writeBinn->addUint8(self::FSERV_FILEINFO);
        $writeBinn->addStr($path);

        $read = $this->writeAndReadSocket($writeBinn->serialize());

        $readBinn = new BinnList;

        $readBinn->binnOpen($read);
        $results = $readBinn->unserialize();

        if ($results[0] != self::FSERV_STATUS_OK) {
            throw new RuntimeException('GDaemon metadata error:' . isset($results[1]) ? $results[1] : 'Unknown');
        }

        $fileInfo = $results[2];

        return [
            'name' => basename($fileInfo[0]),
            'size' => $fileInfo[1],
            'type' => ($fileInfo[2] == 1) ? 'dir' : 'file',
            'mtime' => $fileInfo[3],
            'atime' => $fileInfo[4],
            'ctime' => $fileInfo[5],
            'permissions' => $fileInfo[6],
            'mimetype' => $fileInfo[7],
        ];
    }
public function metadata($path)
    {
        $writeBinn= new BinnList;

        $writeBinn->addUint8(self::FSERV_FILEINFO);
        $writeBinn->addStr($path);

        $read = $this->writeAndReadSocket($writeBinn->serialize());

        $readBinn = new BinnList;

        $readBinn->binnOpen($read);
        $results = $readBinn->unserialize();

        if ($results[0] != self::FSERV_STATUS_OK) {
            throw new RuntimeException('GDaemon metadata error:' . isset($results[1]) ? $results[1] : 'Unknown');
        }

        $fileInfo = $results[2];

        return [
            'name' => basename($fileInfo[0]),
            'size' => $fileInfo[1],
            'type' => ($fileInfo[2] == 1) ? 'dir' : 'file',
            'mtime' => $fileInfo[3],
            'atime' => $fileInfo[4],
            'ctime' => $fileInfo[5],
            'permissions' => $fileInfo[6],
            'mimetype' => $fileInfo[7],
        ];
    }
public function metadata ( $ path ) { $ writeBinn = new BinnList ; $ writeBinn -> addUint8 ( self :: FSERV_FILEINFO ) ; $ writeBinn -> addStr ( $ path ) ; $ read = $ this -> writeAndReadSocket ( $ writeBinn -> serialize ( ) ) ; $ readBinn = new BinnList ; $ readBinn -> binnOpen ( $ read ) ; $ results = $ readBinn -> unserialize ( ) ; if ( $ results [ 0 ] != self :: FSERV_STATUS_OK ) { throw new RuntimeException ( 'GDaemon metadata error:' . isset ( $ results [ 1 ] ) ? $ results [ 1 ] : 'Unknown' ) ; } $ fileInfo = $ results [ 2 ] ; return [ 'name' => basename ( $ fileInfo [ 0 ] ) , 'size' => $ fileInfo [ 1 ] , 'type' => ( $ fileInfo [ 2 ] == 1 ) ? 'dir' : 'file' , 'mtime' => $ fileInfo [ 3 ] , 'atime' => $ fileInfo [ 4 ] , 'ctime' => $ fileInfo [ 5 ] , 'permissions' => $ fileInfo [ 6 ] , 'mimetype' => $ fileInfo [ 7 ] , ] ; }
Get file metadata

@param string $path
@return array
Get file metadata