Strange error - FindFirstFile,FindNextFile does not return any files but files exists!

D

Dmitry Bond.

Hello.

I faced with strange behaviour happens on Win2000 SP4 - my application
(written Delphi7) uses WinAPI functions FindFirstFile/FindNextFile to
load list of files from one specific directory on local NTFS disk (not
the network one!). But last 2 month it often starts to report "no files
in directory" when files really exists there!

I found the following workaround - right-click on that directory in
Explorer, choose Properties, choose Security, unmark "Allow inheritable
permissions from parent to propagate to this object", choose [Remove],
then add user "Everyone" with full control permissions. After that my
application able to see files in that directory.
I'm quite puzzled - why Explorer (and FAR and Total Commaner too) can
see files but my application not?! I do not see any differencies - all
applications running manually with the same credentials...

Why this situations happens? How can I avoid such problem with
FindFirstFile/FindNextFile? Maybe there are exists other functions to
read list of files in directory?


WBR,
Dmitry.

ps. I' sure - there are no viruses (we check it pretty often and
run-time scan is configured too - we use SAV 8.0).

pps. I remember there was a case when that directory was shared for
network access, but sharing now removed. Maybe this is root of
problem...
But anyway - it does not answer - why Explorer (FAR, TC, etc.) see
files in directory but my application not?!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top