CakeFest 2024: The Official CakePHP Conference

ssh2_sftp_stat

(PECL ssh2 >= 0.9.0)

ssh2_sftp_statUzak dosya sistemindeki bir dosyanın durum bilgisini döndürür

Açıklama

ssh2_sftp_stat(resource $sftp, string $dosya): array

Bir sembolik bağın hedefindeki dosya sistemi üzerinde bulunan bir dosyanın durum bilgisini alır.

Bu işlev, stat() işlevini ssh2.sftp:// sarmalayıcısı ile kullanmaya eşdeğer olup ikisi de aynı sonucu döndürür.

Bağımsız Değişkenler

sftp

ssh2_sftp() tarafından açılmış bir SSH2 SFTP özkaynağı.

dosya

Dönen Değerler

Dönen değerlerle ilgili ayrıntılı bilgi edinmek için stat() işlevinin açıklamasına bakınız.

Örnekler

Örnek 1 - SFTP üzerinden bir dosyanın durum bilgisini almak

<?php
$baglanti
= ssh2_connect('shell.example.com', 22);
ssh2_auth_password($baglanti, 'birey', 'parola');

$sftp = ssh2_sftp($baglanti);
$statinfo = ssh2_sftp_stat($sftp, '/bir/yol/dosya');

$dosyaboyu = $statinfo['size'];
$grup = $statinfo['gid'];
$sahibi = $statinfo['uid'];
$eriszaman = $statinfo['atime'];
$degiszaman = $statinfo['mtime'];
kip = $statinfo['mode'];
?>

Ayrıca Bakınız

  • ssh2_sftp_lstat() - Uzak sunucudaki bir sembolik bağın durum bilgisini döndürür
  • lstat() - Bir dosya veya sembolik bağ hakkında bilgi verir
  • stat() - Bir dosya hakkında bilgi döndürür

add a note

User Contributed Notes 3 notes

up
0
gmmarcus at outlook dot my
9 years ago
Just to add further, that was for a php 5.3.5 box running a 64 bit linux os....
i havent tested on other versions yet.

But there is quite a lot of noise about this in php bug list.
up
0
gmmarcus at outlook dot my
9 years ago
Pls note that stat does not seem to give proper filesizes even with 64 bit php if files > 2Gb
up
0
Darren Wolfe
11 years ago
As with stat(), the returned size of the file may be wrong if it is over 2GB.
To Top