What is the xbasic syntax to display the contents of a folder the path of which is held in a global variable.
Bob
Bob
Alpha Software Mobile Development Tools: Alpha Anywhere | Alpha TransForm |
[COLOR=blue]'These are the files I'm looking for:[/COLOR] Archived.tst Hidden_archived.tst Hidden_not_archived.tst Not_archived.tst Test_folder.tst Test_folder_hidden.tst [COLOR=blue]'"Archived" means the Archive bit under the advanced properties is checked. This 'means the file has been modified since it was last backed up and, therefore, 'needs to be included in the next backup. Not all backup programs use this. 'NOTE: According to my tests, how the Archive bit is set for a directory doesn't 'seem to have any effect on the results of filefind.get().[/COLOR] [COLOR=blue]'Returns all files and folders that are not hidden. (Note the folder "Test_folder.tst")[/COLOR] ?[COLOR=green]filefind.get([/COLOR] "E:\*.tst",file_find_normal) = Archived.tst Not_archived.tst Test_folder.tst [COLOR=blue]'But I know there are some hidden files and I want to list those also. [/COLOR]?[COLOR=#008000]filefind.get([/COLOR] "E:\*.tst",file_find_normal+file_find_hidden) = "" [COLOR=blue]'FYI - This eliminates the folders but does not show the hidden files. [/COLOR]?[COLOR=#008000]filefind.get([/COLOR] "E:\*.tst",file_find_not_directory) = Archived.tst Not_archived.tst [COLOR=blue]'And now we get nothing. [/COLOR]?[COLOR=#008000]filefind.get([/COLOR] "E:\*.tst",file_find_not_directory+file_find_hidden) = "" ?[COLOR=#008000]filefind.get([/COLOR] "E:\*.tst",file_find_hidden+file_find_archive+file_find_not_archive) = "" [COLOR=blue]'Finally we get hidden files! This gives me the two hidden files and the 'archive' file 'that is not hidden BUT not the Not_archived.tst file and neither of the folders.[/COLOR] ?[COLOR=#008000]filefind.get([/COLOR] "E:\*.tst",file_find_hidden+file_find_archive) = Archived.tst Hidden_archived.tst Hidden_not_archived.tst ?[COLOR=#008000]filefind.get([/COLOR] "E:\*.tst",file_find_hidden+file_find_archive+file_find_not_archive) = "" ?[COLOR=#008000]filefind.get([/COLOR] "E:\*.tst",file_find_hidden+file_find_not_archive) = "" ?[COLOR=#008000]filefind.get([/COLOR] "E:\*.tst",file_find_hidden+file_find_not_directory) = "" [COLOR=blue]'This seems to be the only way to get the "not_archive" file.[/COLOR] ?[COLOR=#008000]filefind.get([/COLOR] "E:\*.tst",file_find_not_archive) = "Not_archived.tst" [COLOR=blue]'This gets all folders including the hidden folder.[/COLOR] ?[COLOR=#008000]filefind.get([/COLOR] "E:\*.tst",FILE_FIND_DIRECTORY+file_find_hidden) = Test_folder.tst Test_folder_hidden.tst [COLOR=blue]'This seems to be the only way to get all of them "together". 'Note that you must include a crlf() between each one when combining the lists.[/COLOR] ?[COLOR=green]sortsubstr(filefind.get( [/COLOR]"E:\*.tst",file_find_hidden+file_find_archive)+[COLOR=green]crlf()[/COLOR]+[COLOR=green]filefind.get([/COLOR] "E:\*.tst",file_find_not_archive)+[COLOR=green]crlf()[/COLOR]+[COLOR=green]filefind.get([/COLOR] "E:\*.tst",FILE_FIND_DIRECTORY+file_find_hidden),[COLOR=green]crlf()[/COLOR]) = Archived.tst Hidden_archived.tst Hidden_not_archived.tst Not_archived.tst Test_folder.tst Test_folder_hidden.tst
Comment