![]() |
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
(PowerBuilder) Transition from SFtp.ReadDir to SFtp.ReadDirListingProvides instructions for replacing deprecated ReadDir method calls with ReadDirListing. Note: This example requires Chilkat v11.0.0 or greater.
integer li_rc integer li_Success oleobject loo_Sftp string ls_Handle oleobject loo_DirObj oleobject loo_DirOut li_Success = 0 loo_Sftp = create oleobject li_rc = loo_Sftp.ConnectToNewObject("Chilkat.SFtp") if li_rc < 0 then destroy loo_Sftp MessageBox("Error","Connecting to COM object failed") return end if // ... // ... ls_Handle = loo_Sftp.OpenDir(".") // ... // ... // ------------------------------------------------------------------------ // The ReadDir method is deprecated: loo_DirObj = loo_Sftp.ReadDir(ls_Handle) if loo_Sftp.LastMethodSuccess = 0 then Write-Debug loo_Sftp.LastErrorText destroy loo_Sftp return end if // ... // ... destroy loo_DirObj // ------------------------------------------------------------------------ // Do the equivalent using ReadDirListing. // Your application creates a new, empty SFtpDir object which is passed // in the last argument and filled upon success. loo_DirOut = create oleobject li_rc = loo_DirOut.ConnectToNewObject("Chilkat.SFtpDir") li_Success = loo_Sftp.ReadDirListing(ls_Handle,loo_DirOut) if li_Success = 0 then Write-Debug loo_Sftp.LastErrorText destroy loo_Sftp destroy loo_DirOut return end if // ... // ... loo_Sftp.CloseHandle(ls_Handle) destroy loo_Sftp destroy loo_DirOut |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.