LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to retrieve files in directory (name+nb) with only the directory name

Hello,

I would like to check files with a specific extension on a directory. I have the extensions and the directory name but the filename and the number of files is unknown. Is there exist a set of function to perform this task. Any idea ?

Thanks

ArnO
0 Kudos
Message 1 of 7
(3,538 Views)
You can use GetFirstFile and GetNextFile to loop through all the file names in a directory. You can find these functions in the utility library. You will check the extensions when you get the filename strings back.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 7
(3,538 Views)
I try this but without results. For the GetFirstFile I had nothing and getNextFile returns "COSM" ?
Any comments ?
0 Kudos
Message 3 of 7
(3,538 Views)
It works fine for me. Maybe you aren't putting in the right search path. If you want to search a directory like c:\windows, the search path will be c:\windows\*.*. Take a look at the attached example and see if you can get it to work.

Chris
0 Kudos
Message 4 of 7
(3,538 Views)
Thanks it works with *.* which is not indicates in the function help. I was working with only the directory path.

I have post a question few days ago about a problem on displaying bitmaps in canvas with a zoom factor different from 1 under Windows 2000. Someone replys that he has reproduced this bug, any idea for the way to fix it.

Thank you Chris

arnO
0 Kudos
Message 5 of 7
(3,538 Views)
Actually, if you look for the help on the search path argument in the GetFirstFile function panel you should see the discussion on * and *.* wildcards being used.

Sorry, I don't really have any good advice on your display problem. I don't really know what you mean about "zoom factor". How are you "zooming" a bitmap. Our canvas do not have advanced image processing built for things like pixel elimination in display, etc. Therefore, in displaying bitmaps at a size other than the actual size of X by X pixels could result in horizontal or vertical bars due to pixel intersections. If you are just drawing a bitmap at a rect size other than the actual size, it doesn't suprise me that the drawing may have flaws since we don't
have algorithms in the canvas to do scaling of image files.

Chris
0 Kudos
Message 6 of 7
(3,538 Views)
You will find my first question and the answer here
http://exchange.ni.com/servlet/Redirect?id=2748124

The display trouble has been seen only under windows 2000 and not under 98. Please find attached my display function.

thanks in advance

ArnO
0 Kudos
Message 7 of 7
(3,538 Views)