Hi,
Just wondering how Dirlist sorts its files retrieved ?
It seems to me that Dirlist (when reading a folder containing hundreds of files) randomly sorts its files or is there any kind of logic to be found in its sorting process ?
Second : to be able to process the files of a folder based on their creation date and time (oldest files first), i guess i need to use a datawindow and some api calls (findfirstfile etc.) ? I remember someone posted an example of this a while back ... Anybody still have this link please ?
TIA
John
Request clarification before answering.
The sort order would be by name if you have Sorted property set to true.
For dated sort go with TopWiz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have an example with many of the file Win API functions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can use these APIs to browse a folder :
FUNCTION ulong FindFirstFile(ref string lpszSearchFile, ref WIN32_FIND_DATA lpffd) LIBRARY "kernel32.dll" ALIAS FOR "FindFirstFileW"
FUNCTION boolean FindNextFile(ulong hfindfile, ref WIN32_FIND_DATA lpffd) LIBRARY "kernel32.dll" ALIAS FOR "FindNextFileW"
structure str_filetime :
global type str_filetime from structure
ulong ul_LowDateTime
ulong ul_HighDateTime
end type
and structure WIN32_FIND_DATA :
global type win32_find_data from structure
unsignedlong dwfileattributes
str_filetime ftcreationtime
str_filetime ftlastaccesstime
str_filetime ftlastwritetime
unsignedlong nfilesizehigh
unsignedlong nfilesizelow
unsignedlong dwreserved0
unsignedlong dwreserved1
character filename[260]
character altfilename[14]
end type
Regards.
Abdallah.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
There is a solution in PFC (see PFC - Home) in the file service. The function of_dirlist in pfc_n_cst_filesrvunicode contains all you need to get the files with its properties (e.g. creation time). In of_sortdirlist of pfc_n_cst_filesrv you can find a solution for sorting the files using a datawindow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.