Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Jan : How to detect if a folder contains no files

www.cryer.info
Managed Newsgroup Archive

How to detect if a folder contains no files

Subject:How to detect if a folder contains no files
Posted by:"Francesco Savastano" (francosavasta..@takethisoutfromaddress.virgilio.it)
Date:Fri, 13 Jan 2006 16:32:13 +0100

Hello I want to detect if a folder contains no files. Notice that since I am
going to prompt the user of my application to delete or recycle to bin that
folder, I must be sure that it really contains no files at all! So i want to
check existence of every kind of possible files, included hidden files,
system files etc..so I am looking for the safest test possible around. (I
wanted to use findfirst and findnext to do this but i am not sure how much
safe is to rely on this method)
Is there a truly safe way to do this (something working on any windows
platform)? Cause I dont want risk my application to delete any folder that
contains files.
Thanx for any answer,
Francesco.

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive