Additional Documentation:

ssh2_sftp(), ssh2_sftp_stat(), ssh2_sftp_lstat()


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@175989 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Sara Golemon 2004-12-30 05:35:30 +00:00
parent 9eb1e8a12a
commit 025d1bab3c
3 changed files with 106 additions and 13 deletions

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
<refentry id="function.ssh2-sftp-lstat">
<refnamediv>
@ -16,10 +16,43 @@
<methodparam><type>string</type><parameter>path</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Stats a symbolic link on the remote filesystem <emphasis>without</emphasis>
following the link.
</para>
following the link. This function is similar to using the
<function>lstat</function> function with the
<link linkend="wrappers.ssh2">ssh2.sftp://</link> wrapper in PHP5
and returns the same values. See the documentation for
<function>stat</function> for details on the values which may be returned.
</simpara>
<example>
<title>Stating a symbolic link via SFTP</title>
<programlisting role="php">
<![CDATA[
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$sftp = ssh2_sftp($connection);
$statinfo = ssh2_lstat($sftp, '/path/to/symlink');
$filesize = $statinfo['size'];
$group = $statinfo['gid'];
$owner = $statinfo['uid'];
$atime = $statinfo['atime'];
$mtime = $statinfo['mtime'];
$mode = $statinfo['mode'];
?>
]]>
</programlisting>
</example>
<simpara>
See Also:
<function>ssh2_sftp_stat</function>,
<function>lstat</function>, and
<function>stat</function>
</simpara>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
<refentry id="function.ssh2-sftp-stat">
<refnamediv>
@ -16,10 +16,42 @@
<methodparam><type>string</type><parameter>path</parameter></methodparam>
</methodsynopsis>
<para>
Stats a remote file. If the file is a symbolic link, it follows the link
and stats its target.
</para>
<simpara>
Stats a file on the remote filesystem following any symbolic links.
This function is similar to using the <function>stat</function> function
with the <link linkend="wrappers.ssh2">ssh2.sftp://</link> wrapper in PHP5
and returns the same values. See the documentation for
<function>stat</function> for details on the values which may be returned.
</simpara>
<example>
<title>Stating a file via SFTP</title>
<programlisting role="php">
<![CDATA[
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$sftp = ssh2_sftp($connection);
$statinfo = ssh2_stat($sftp, '/path/to/symlink');
$filesize = $statinfo['size'];
$group = $statinfo['gid'];
$owner = $statinfo['uid'];
$atime = $statinfo['atime'];
$mtime = $statinfo['mtime'];
$mode = $statinfo['mode'];
?>
]]>
</programlisting>
</example>
<simpara>
See Also:
<function>ssh2_sftp_lstat</function>,
<function>lstat</function>, and
<function>stat</function>
</simpara>
</refsect1>
</refentry>

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
<refentry id="function.ssh2-sftp">
<refnamediv>
@ -15,9 +15,37 @@
<methodparam><type>resource</type><parameter>session</parameter></methodparam>
</methodsynopsis>
<para>
Request the SFTP subsystem from an already connected SSH2 server
</para>
<simpara>
Request the SFTP subsystem from an already connected SSH2 server.
</simpara>
<simpara>
This method returns an <literal>SSH2 SFTP</literal> resource for use with
all other ssh2_sftp_*() methods and the
<link linkend="wrappers.ssh2">ssh2.sftp://</link> fopen wrapper.
</simpara>
<example>
<title>Opening a file via SFTP</title>
<programlisting role="php">
<![CDATA[
<?php
$connection = ssh2_connect('shell.example.com', 22);
ssh2_auth_password($connection, 'username', 'password');
$sftp = ssh2_sftp($connection);
$stream = fopen("ssh2.sftp://$sftp/path/to/file", 'r');
?>
]]>
</programlisting>
</example>
<simpara>
See Also:
<function>ssh2_scp_send</function>, and
<function>ssh2_scp_recv</function>
</simpara>
</refsect1>
</refentry>