|  | 
Chilkat  HOME  Android™  AutoIt  C  C#  C++  Chilkat2-Python  CkPython  Classic ASP  DataFlex  Delphi DLL  Go  Java  Node.js  Objective-C  PHP Extension  Perl  PowerBuilder  PowerShell  PureBasic  Ruby  SQL Server  Swift  Tcl  Unicode C  Unicode C++  VB.NET  VBScript  Visual Basic 6.0  Visual FoxPro  Xojo Plugin
| (PureBasic) chmod (Setting File Permissions)This example assumes your FTP server supports the "chmod" command, which typically means it must be a server running on a Linux or Unix system. The SendCommand method may be called to send arbitrary commands to the FTP server. This example sends a "chmod" command to set the file permissions. 
 IncludeFile "CkFtp2.pb" Procedure ChilkatExample() ; This example requires the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. ftp.i = CkFtp2::ckCreate() If ftp.i = 0 Debug "Failed to create object." ProcedureReturn EndIf CkFtp2::setCkHostname(ftp, "ftp.cknotes.com") CkFtp2::setCkUsername(ftp, "myLogin") CkFtp2::setCkPassword(ftp, "myPassword") ; Connect and login to the FTP server. success.i = CkFtp2::ckConnect(ftp) If success <> 1 Debug CkFtp2::ckLastErrorText(ftp) CkFtp2::ckDispose(ftp) ProcedureReturn EndIf ; Send a chmod command to the FTP server to set ; the permissions of a file to 0644: resp.s = CkFtp2::ckSendCommand(ftp,"chmod 0644 hamlet.xml") If CkFtp2::ckLastMethodSuccess(ftp) <> 1 ; Failed. Debug CkFtp2::ckLastErrorText(ftp) Else ; You should write code to examine the response to ; the SendCommand. As an example, the FTP server ; used for testing responds with this for success: ; 200 Permissions changed on hamlet.xml Debug resp EndIf success = CkFtp2::ckDisconnect(ftp) CkFtp2::ckDispose(ftp) ProcedureReturn EndProcedure | ||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.