Re: symlinks, lstat, relative/absolute combos
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=uBb6jouebnyWllFhVAvZOLkizjq1xcqI8R4/ieLFWdU=; b=a0zGpY2mkFz5SXGfIxRuabPoRV3yBpkgXVyQeWdBuVKczAGhO8BE0BOkmPxA6m8PpF 9gS1hrjQmb+4FJTja4j3TePxei6D7jIGu4pJTyr0w2kDvQuuiRUrrhLcu8fns1FMj5Bf +goJ0+5WoDNPMiROegcdn78rkDmNps4iuKTX4= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=h8lvKLxvE61CZ1MhxwULBmlLBh9sFXAlOj3Eit9aceiznlfjZzaY2Gmm/+12SXzZT5 c5JeEgvDxJQoEox4aI6y67dcX48AqaWO/ndiAOrZFcccq0Q+y2AHE5hY/sld0wzU99lp 7E5HFrATJvYmInvV8YwM4W1a1/o6bbs1Z+cfY= On 22 March 2011 11:18, Tilghman Lesher <tilghman@meg.abyt.es> wrote:
On Tuesday 22 March 2011 13:03:15 James Peach wrote:
On 22 March 2011 06:08, Steven Abner <pheonix@zoomtown.com> wrote:
Hi , I was working on Mac symlinks(unix style) and encountered things I couldn't find information on through web searches. I was thinking these are Mac specific flags and meanings, so with that intro: when you lstat() a symlink, lstat states that st_size will be the size of the pathname for the link, what does it mean when it is a link with st_size = 0, yet it does have a link?
I believe that the st_size of a symlink is a filesystem implementation detail. You should not rely on it for anything serious.
That may be, but it's still in POSIX: http://pubs.opengroup.org/onlinepubs/009695399/functions/lstat.html
Not every filesystem is posix compliant.
I just verified on my own system that it is working correctly for an HFS+ filesystem. The OP may wish to verify his own code is working correctly by comparing his output to that of 'stat -x {file}'.
-- Tilghman _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/jorgar%40gmail.com
This email sent to jorgar@gmail.com
-- James Peach | jorgar@gmail.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
James Peach