General
cancel
Showing results for 
Search instead for 
Did you mean: 

Find command does not see files until directory is accessed

Brecht De Baets
Frequent Advisor

Find command does not see files until directory is accessed

Hi,

We have a HP Unix B.11.23 on which we have a mounted directory to a windows server "/mnt/index".
In this directory there are several subdirectories (one for each user) where the users can drop some files (through their "windows" client PC's). A program then reads these directories and indexes the files that the users have dropped. I now have the following problem. Sometimes some dropped files are not seen by the "find /mnt/index -type f" command.
This happens only sometimes and for some files only (which are not different from the other files). The problem to find these specific files keeps persisting until the user accesses the directory in which the files are stored (on his windows client PC) or when I execute the following command : ll /mnt/index/01_user where 01_user is the subdir where the files are stored. After that the find-command does find the files.

Isn't that strange ?

Best regards,
2 REPLIES
Viktor Balogh
Honored Contributor

Re: Find command does not see files until directory is accessed

it sounds like you have an automounter. Are you using CIFS? I've not heard of a CIFS automounter.

>mounted directory to a windows server "/mnt/index".

I guess you wanted to say "from a windows server", or how can you run a find command on windows?

please clarify, what protocol, which os version, and which box shares the filesystem to which client
****
Unix operates with beer.
Brecht De Baets
Frequent Advisor

Re: Find command does not see files until directory is accessed

On a windows 2003 server we have the following folder \\server\indexering.
I just have a mount in unix on that folder(through /etc/fstab => cifs). The name of the directory in unix is /mnt/index.

The windows directory (indexering) which is mounted contains subfolders (one for each user). The users are dropping files through their client windows PC's in these subfolders.

So if I execute a find statement in unix I should see these files (find /mnt/index -type f). In 99 % of the cases I do see these files when I execute a "find -type f" command, but sometimes the find command does not find the file, however an "ll" command does find it and after executing an "ll" command the find command also does find the file.

So :
1) User saves a file in a subdirectory on
their client PC's (windows XP) for
example in \\server\indexering\user_a
2) Most of the times (in unix)
"find /mnt/index -type f" gives this
saved file as a result. But sometimes it
doesn't. So let's say "find /mnt/index -
type f" gives no result.
3) After the user accesses the folder in
windows explorer to see if the file is
there (\\server\indexering\user_a)
OR
After in unix I execute the statement :
ll /mnt/index/user_a
=> the command "find /mnt/index -type f"
does find the file.