![]() |
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
(Unicode C) 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.
#include <C_CkSFtpW.h> #include <C_CkSFtpDirW.h> void ChilkatSample(void) { BOOL success; HCkSFtpW sftp; const wchar_t *handle; HCkSFtpDirW dirObj; HCkSFtpDirW dirOut; success = FALSE; sftp = CkSFtpW_Create(); // ... // ... handle = CkSFtpW_openDir(sftp,L"."); // ... // ... // ------------------------------------------------------------------------ // The ReadDir method is deprecated: dirObj = CkSFtpW_ReadDir(sftp,handle); if (CkSFtpW_getLastMethodSuccess(sftp) == FALSE) { wprintf(L"%s\n",CkSFtpW_lastErrorText(sftp)); CkSFtpW_Dispose(sftp); return; } // ... // ... CkSFtpDirW_Dispose(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. dirOut = CkSFtpDirW_Create(); success = CkSFtpW_ReadDirListing(sftp,handle,dirOut); if (success == FALSE) { wprintf(L"%s\n",CkSFtpW_lastErrorText(sftp)); CkSFtpW_Dispose(sftp); CkSFtpDirW_Dispose(dirOut); return; } // ... // ... CkSFtpW_CloseHandle(sftp,handle); CkSFtpW_Dispose(sftp); CkSFtpDirW_Dispose(dirOut); } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.