find {start} -ls - Two Passes?

I have a "find {start} -ls" command listing all files and dirs in on the whole filesystem.

As part of this it lists locations that contain temporary files and, sometimes when executing, it identifies a file but produces an ERROR when trying to list it.

ERROR thrown: find: bad status-- {filename}

This only occurs on temporary files which are not present when we manually look for them after the ERROR is seen. As such we believe that it is caused by the file vanishing between the "find {start}" part and the "-ls" part of the command.

Can someone confirm that "find -ls" uses two passes?
If this is the case, then can someone suggest a one pass alternative that gives the full path of each file/dir and long output?

Thanks in advance.

The "problem" with AIX utilities is that I can't "crack them open" short of using ProbeVue or truss. (You have no access to the source.) But I can say this: The information you speak of comes from two different calls. readdir() "scans" for all files in a directory, and stat() (or variant) gives the ls info.

If you do not need the ls information then the call to stat() would (should) never be made unless you are filtering on access time or something like that.

My recommendation is to capture stderr so you can avoid the ugliness you speak of. If the error message is mixed in stdout, it would be trivial to write your own version in C that does not (watch out for soft links if you do). Another option is to look at the -R option to ls, it may produce similar output but generate errors that are different (once again, provided that you are getting stuff that should be stderr in your stdout).

Top notch wfavorite. Thanks.

I will look into the effectiveness of using stderr. I'll let you know how I get on.