Lines Matching refs:filename

23  *    $sftp->put('filename.ext', 'hello, world!');
876 list(, $filename) = Strings::unpackSSH2('Ns', $response);
877 return $filename;
1128 // SFTPv4 "removed the long filename from the names structure-- it can now be
1140 $contents[$shortname] = $attributes + ['filename' => $shortname];
1192 case $a['filename'] === '.' || $b['filename'] === '.':
1193 if ($a['filename'] === $b['filename']) {
1196 return $a['filename'] === '.' ? -1 : 1;
1197 case $a['filename'] === '..' || $b['filename'] === '..':
1198 if ($a['filename'] === $b['filename']) {
1201 return $a['filename'] === '..' ? -1 : 1;
1224 case 'filename':
1225 $result = strcasecmp($a['filename'], $b['filename']);
1254 * $sftp->setListOrder('filename', SORT_ASC);
1255 * $sftp->setListOrder('size', SORT_DESC, 'filename', SORT_ASC);
1378 * @param string $filename
1381 public function stat($filename)
1387 $filename = $this->realpath($filename);
1388 if ($filename === false) {
1393 $result = $this->query_stat_cache($filename);
1402 $stat = $this->stat_helper($filename, NET_SFTP_STAT);
1404 $this->remove_from_stat_cache($filename);
1409 $filename .= '/.';
1411 $this->update_stat_cache($filename, (object) ['stat' => $stat]);
1416 $stat['type'] = $this->chdir($filename) ?
1422 $filename .= '/.';
1424 $this->update_stat_cache($filename, (object) ['stat' => $stat]);
1434 * @param string $filename
1437 public function lstat($filename)
1443 $filename = $this->realpath($filename);
1444 if ($filename === false) {
1449 $result = $this->query_stat_cache($filename);
1458 $lstat = $this->stat_helper($filename, NET_SFTP_LSTAT);
1460 $this->remove_from_stat_cache($filename);
1465 $filename .= '/.';
1467 $this->update_stat_cache($filename, (object) ['lstat' => $lstat]);
1471 $stat = $this->stat_helper($filename, NET_SFTP_STAT);
1475 $this->update_stat_cache($filename, (object) ['lstat' => $lstat]);
1480 $lstat['type'] = $this->chdir($filename) ?
1486 $filename .= '/.';
1488 $this->update_stat_cache($filename, (object) ['lstat' => $lstat]);
1499 * @param string $filename
1504 private function stat_helper($filename, $type)
1507 $packet = Strings::packSSH2('s', $filename);
1526 * @param string $filename
1530 public function truncate($filename, $new_size)
1534 return $this->setstat($filename, $attr, false);
1542 * @param string $filename
1548 public function touch($filename, $time = null, $atime = null)
1554 $filename = $this->realpath($filename);
1555 if ($filename === false) {
1570 $packet = Strings::packSSH2('s', $filename);
1590 return $this->setstat($filename, $attr, false);
1603 * @param string $filename
1608 public function chown($filename, $uid, $recursive = false)
1637 return $this->setstat($filename, $attr, $recursive);
1650 * @param string $filename
1655 public function chgrp($filename, $gid, $recursive = false)
1661 return $this->setstat($filename, $attr, $recursive);
1671 * @param string $filename
1676 public function chmod($mode, $filename, $recursive = false)
1678 if (is_string($mode) && is_int($filename)) {
1680 $mode = $filename;
1681 $filename = $temp;
1685 if (!$this->setstat($filename, $attr, $recursive)) {
1692 $filename = $this->realpath($filename);
1696 $packet = pack('Na*', strlen($filename), $filename);
1716 * @param string $filename
1722 private function setstat($filename, $attr, $recursive)
1728 $filename = $this->realpath($filename);
1729 if ($filename === false) {
1733 $this->remove_from_stat_cache($filename);
1737 $result = $this->setstat_recursive($filename, $attr, $i);
1742 $packet = Strings::packSSH2('s', $filename);
1799 foreach ($entries as $filename => $props) {
1804 $temp = $path . '/' . $filename;
1880 list($filename) = Strings::unpackSSH2('s', $response);
1882 return $filename;
2061 * So, for example, if you set $data to 'filename.ext' and then do \phpseclib3\Net\SFTP::get(), you will get a file, twelve bytes
2062 * long, containing 'filename.ext' as its contents.
2065 * contain as many bytes as filename.ext does on your local filesystem. If your filename.ext is 1MB then that is how
2594 foreach ($entries as $filename => $props) {
2599 $temp = $path . '/' . $filename;
2661 * Tells whether the filename is a directory
2676 * Tells whether the filename is a regular file
2691 * Tells whether the filename is a symbolic link
2733 * Tells whether the filename is writable
2760 * Tells whether the filename is writeable