LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GetFirstFile, GetNexFile - Internal process

Hi,

1 -
How GetFirstFile determine the first file (whatever the search criteria) :
- by aplphabetic order ?
- by date ?
- ... ?

2 -
Does GetFirstFile create a list of file corresponding to the search criteria ?
Does GetNextFile only go through this list ?

3 -
What happens if, between a GetFirstFile call and a GetNextFile call, the list of file is deleted (for ex.) or modified ?
Can GetNextFile give a file name which does not exist any more ?

4 -
How to take into account a possible evolution oh the list of file between a GetFirstFile call and a GetNextFile call ?


Thanks for your help.
0 Kudos
Message 1 of 3
(3,350 Views)
I know only one:
it gets all the files by alphabetic

For all your problems the sample (samples\sdk\audio\sndplay) perhaps helps...
0 Kudos
Message 2 of 3
(3,346 Views)
Hello,

1. The order of results returned by GetFirstFile depends on the platform. You will find this information in the following Knowledge Base :
- "Order of Results Returned by GetFirstFile and GetNextFile Functions":
http://digital.ni.com/public.nsf/websearch/CCDF9D76E197272F86256F78000269E3?OpenDocument

2. Indeed, GetFirstFile() create a list of files matching to the criteria that is used by the GetNextFile() function.

3. As a consequence, if a file is deleted after the call to the GetFirstFile() function, GetNextFile() can give the name of a deleted file.

4. To avoid this issue, you can use the GetFileAttrs(...) function after each call to GetNextFile(). This function will return -1 if the file no more exists.

Best regards.

Benjamin
NI France
Message 3 of 3
(3,315 Views)