FileListBox doesn't see the files

I have a couple of strange files on our NT server that seem to be invisible to a FileListBox, but can be found when I check for their existence using a call to FileExists(...)!  

Any reason why FileListBox would not see files that FileExist would see?

My FileListBox Code is similar to this:
FileListBox.Directory := "y:\projects\";
FileListBox.mask := "pd3001.*"
FileListBox.Update;
If FileListBox.Items.Count > 1 then ...';

My FileExists Code is similar to this;
If FileExists("y:\projects\pd3001.*") then ...;

When I use FileExists(), I am trying to determine if ANY file exists for a given filename.  When I use FileListBox(), I am trying to determine how MANY file exists for a given filename (ie, PD3001.TXT and PD3001.DOC).

Please help, this is causing problems with new software I've just rolled out at work!
LVL 4
wkhaysAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

wkhaysAuthor Commented:
Edited text of question.
0
williams2Commented:
Severel issues to this problem is unclear:

1. Could it be that the permissions to this file is too low ?
2. What is the real name of the file you are mentioning ?
3. Could it be that the file is a temporary file ?
4. Could it be that the file is a virtual file, only known to the Shell interface ?

Regards,
Williams
0
wkhaysAuthor Commented:
Thanks for responding....

The file in question is really called PD30001.DWG.  It is an AutoCad drawing.

When I double-click on it in Windows Explorer, it loads up fine.  It appears to be just a normal file.  FileExists() sees it as a normal file.  

What I am trying to do is to determine whether AutoCad has created a PD30001.BAK file...   So I am checking FileListBox.Items.Count("...\PD30001.*").  This works will all other files in the directory except this file!!!!

When I set up a FileListBox with the mask set at *.*, all files show up EXCEPT this file.  I can't figure out what is special about this file.

I've never seen this before, but it is happening on two different machines.  I have checked the properties of the file and it is not hidden.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

simonetCommented:
What are the file's attributes? May the file is set as Hidden or System, and, while Explorer is able to show it, TFileListBox isn't.

Alex
0
sburckCommented:
One possibility, even a good probability - the default filetype for TFileListBox is ftNormal.  Setting it to (ftNormal or ftArchive) will generally show all the non-special files.  Archive bits get set all the time by different programs, and then seemingly 'normal' files have an attribute bit which doesn't let them get found.
0
wkhaysAuthor Commented:
I went into NT Explorer and tried to turn off the various bits (hidden, Read-Only, Archive).... I'll look again, because I agree this is the likely scenario....  Let me check again and I'll get back to you.
0
wkhaysAuthor Commented:
Fixed!

In the end, the file was somehow had its SYSTEM bit set... Don't know how it got set and don't know how to clear it.

Anyway, I set my FileListBox up to read System files and I'm off to the races.

Thanks, everyone.  Simonnet - you were first with a close answer.  please answer and I'll award the points.

I thought there was an "accept comment as answer" option coming ...

WKHays
0
simonetCommented:
Thanks, WKHays. I am glad I was able to help.

Yours,

Alex

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.