API16

JFTP/chdir: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Method to change the current working directory on the FTP server <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JFTP/chdir|Edit De...
 
m removing red link to edit, no existant pages
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JFTP/chdir|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JFTP/chdir}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 54: Line 54:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JFTP/chdir|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JFTP/chdir}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
Line 69: Line 69:
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API16]]

Revision as of 02:54, 14 May 2013

Description

Method to change the current working directory on the FTP server

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

chdir($path)
Parameter Name Default Value Description
$path $path Path to change into on the server

Returns

boolean True if successful

Defined in

libraries/joomla/client/ftp.php

Importing

jimport( 'joomla.client.ftp' );

Source Body

function chdir($path) {

        // If native FTP support is enabled lets use it...
        if (FTP_NATIVE) {
                if (@ftp_chdir($this->_conn, $path) === false) {
                        JError::raiseWarning('35', 'JFTP::chdir: Bad response');
                        return false;
                }
                return true;
        }

        // Send change directory command and verify success
        if (!$this->_putCmd('CWD '.$path, 250)) {
                JError::raiseWarning('35', 'JFTP::chdir: Bad response', 'Server response: '.$this->_response.' [Expected: 250] Path sent: '.$path);
                return false;
        }

        return true;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />