SteCam 0 Posted June 7 (edited) I have a Delphi XE app that targets files with the '.yml' extension in a user-selected folder. A user reported that the app was giving duplicate results. It turns out that the user is running the app on Linux with Wine and uses an editor that creates backup files with the '.yml~' extension (per Linux convention) in the same folder. To my surprise I find that such files are not excluded by a line in my code such as i := FindFirst(strPath + '*.yml', faAnyFile, SearchRec); That is, the file mask '* .yml' also picks up '*.yml~'. Is there a way of specifying the file mask so that this does not occur? Edited June 7 by SteCam Share this post Link to post
Remy Lebeau 1385 Posted June 7 2 hours ago, SteCam said: That is, the file mask '* .yml' also picks up '*.yml~'. Is there a way of specifying the file mask so that this does not occur? Unfortunately no, there is not. You will have to look at the actual extension in SearchRec.Name and ignore any files that are not exactly '.yml'. Share this post Link to post