PDA

View Full Version : `find' error message


VEGAN
Sep 27, 2002, 03:55 PM
I get this error message with `find'<

find: /dev/fd/4: No such file or directory

How do make it go away?

fitter
Sep 27, 2002, 04:50 PM
Originally posted by VEGAN:
I get this error message with `find'<

find: /dev/fd/4: No such file or directory

How do make it go away?

What are you trying to do? /dev is a pseudo-filesystem, created on boot; you really shouldn't spend time trying to manage it.

VEGAN
Sep 27, 2002, 05:25 PM
Originally posted by fitter:


What are you trying to do? /dev is a pseudo-filesystem, created on boot; you really shouldn't spend time trying to manage it.

What I'm saying is that every time I do

sudo find / -name "something"

I get this error, and it's getting annoying.
I don't know why it's there and if I can do something about it [delete the /dev/df/4 (???)].

khufuu
Sep 27, 2002, 10:35 PM
When I go into my /dev/fd directory I have the following:

total 0
crw--w---- 1 sjh tty 4, 1 Sep 27 20:30 0
crw--w---- 1 sjh tty 4, 1 Sep 27 20:30 1
crw--w---- 1 sjh tty 4, 1 Sep 27 20:30 2
dr--r--r-- 2 root wheel 512 Sep 22 10:33 3
dr--r--r-- 2 root wheel 512 Sep 22 10:33 4
dr--r--r-- 2 root wheel 512 Sep 22 10:33 5

I did a 'man fd' and found that (I think) the system uses 0-2 for unix commands so that you can re-direct system output but I've never heard of 3-5 before. I'm guessing that the 'find' command uses this directory for something.

Check out your /dev/fd directory to see if you are missing these directories. If you are, try creating them with the permissions, user, and group settings that you see above.

My 0.02.....

VEGAN
Sep 28, 2002, 03:18 AM
The thing is that `ls' lists it and with the same permissions. That's sort of a why I ask.

If I delete it will it the system create it again?

VEGAN
Sep 28, 2002, 03:22 AM
I don't have the fifth directory [but that can't be the problem because it says "can't find 4"

If I direct the find to the /dev/fd/4 directory I get
"find: /dev/fd/4: Bad file descriptor" What's that?

khufuu
Sep 28, 2002, 10:10 AM
If I try to CD to that directory I get that same error message.

There is obviously something 'special' about these directories. I wouldn't suggest deleting them. You probably wouldn't be able to re-create them the same way.

If I were you, I'd post this same question on macosxhints.com forums to see if anything comes up there.

Sorry I couldn't help. :(

kvm_mkdb
Sep 29, 2002, 04:47 PM
Originally posted by VEGAN:
I don't have the fifth directory [but that can't be the problem because it says "can't find 4"

If I direct the find to the /dev/fd/4 directory I get
"find: /dev/fd/4: Bad file descriptor" What's that?

/dev/fd contains the file descriptors. It's a feature!

The bug is in 'find' - it should ignore /dev/fd. It doesn't sound major to me though.

VEGAN
Sep 29, 2002, 06:20 PM
Originally posted by kvm_mkdb:


/dev/fd contains the file descriptors. It's a feature!

The bug is in 'find' - it should ignore /dev/fd. It doesn't sound major to me though.

It might sound as a serious problem if you are trying to make a script that uses the output of `find'

kvm_mkdb
Sep 29, 2002, 06:25 PM
Originally posted by VEGAN:


It might sound as a serious problem if you are trying to make a script that uses the output of `find'

Check out /etc/periodic/daily/500.daily.

It's executed every day at 3:15 am, and relies heavily on the output of 'find'.

VEGAN
Sep 29, 2002, 06:50 PM
Originally posted by kvm_mkdb:


Check out /etc/periodic/daily/500.daily.

It's executed every day at 3:15 am, and relies heavily on the output of 'find'.

This looked good... I just got panic attacks last night when `find' started acting funky {console displayed tons of strange messages) when I launched my work in progress in the Project Builder.

pelTorro
Oct 4, 2002, 08:47 AM
Originally posted by VEGAN:
I get this error message with `find'<

find: /dev/fd/4: No such file or directory

How do make it go away?
use the -x switch to prevent find from descending into the /dev pseudo-filesystem

% man find
...
-x The -x option prevents find from descending into directories that
have a device number different than that of the file from which
the descent began.
...

this will also prevent find from wandering off into /Volumes