How to get a file descriptor for a symlink?
How to get a file descriptor for a symlink?
- Subject: How to get a file descriptor for a symlink?
- From: "Trainor, Chris" <email@hidden>
- Date: Wed, 29 Oct 2008 17:22:02 -0400
- Thread-topic: How to get a file descriptor for a symlink?
I still haven’t found a way to get a file descriptor for a
symlink (not the target file) on Tiger. I need to use this as the event identifier
when I call kqueue() with the EVFILT_VNODE filter. Does anyone know how
to either get the file descriptor for the symlink or is there a way to pass in
something else as the identifier to the kqueue function?
Thanks
From: Trainor, Chris
Sent: Monday, October 27, 2008 5:26 PM
To: 'Jim Luther'
Cc: email@hidden
Subject: RE: How to get a file descriptor for a symlink?
I actually need to get the file descriptor so that I can pass it
to kqueue().
Thanks
From: Jim Luther
[mailto:email@hidden]
Sent: Monday, October 27, 2008 4:33 PM
To: Trainor, Chris
Cc: email@hidden
Subject: Re: How to get a file descriptor for a symlink?
Chris,
Assuming you want the contents of a symlink file, use
readlink(2).
On Oct 27, 2008, at 11:58 AM, Trainor, Chris wrote:
I am trying to call the open() function on a symlink to get a file
descriptor. I need to open the symlink file, not the target. I can
use the O_SYMLINK flag on Leopard to get this behavior, but that flag is not
available on Tiger. I initially thought O_NOFOLLOW would do what I
wanted, but then realized that is not what it is meant to do. It is
supposed to cause the open() call to fail if the file is a symlink. It
behaves this way on Leopard, but it appears to be broken on Tiger.
Calling open() on Tiger seems to just ignore the O_ NOFOLLOW flag.
The information contained in this email message and its
attachments is intended only for the private and confidential use of the
recipient(s) named above, unless the sender expressly agrees otherwise.
Transmission of email over the Internet is not a secure communications medium.
If you are requesting or have requested the transmittal of personal data, as
defined in applicable privacy laws by means of email or in an attachment to
email you must select a more secure alternate means of transmittal that supports
your obligations to protect such personal data. If the reader of this message
is not the intended recipient and/or you have received this email in error, you
must take no action based on the information in this email and you are hereby
notified that any dissemination, misuse, copying, or disclosure of this
communication is strictly prohibited. If you have received this communication
in error, please notify us immediately by email and delete the original
message.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden