On Aug 6, 2009, at 5:05 PM, Markus wrote:

>
> On Thu, 2009-08-06 at 16:44 -0700, Markus wrote:
>> Luke --
>>
>>> The only question I have is whether we can settle for File.exists?  
>>> or
>>> if we should do an lstat.  Comments?
>>
>> Excellent catch!  File.exists? wraps stat, not lstat, so pointing the
>> link at a non-existent target could have gotten by this.  The main  
>> case
>> was still covered, but it was a sloppy oversight on my part.
>>
>> Revised patch coming up.
>
> So, I'm favoring something like this:
>
> path = ... until not (File.exists?(path) or File.symlink?(path))
>
> rather than:
>
> loop
>    path = ...
>    begin
>        File.lstat(path)
>    rescue Errno::ENOENT
>        break
>    rescue
>        raise
>    end
> end
>
> or doing like tidy.rb, et al, and embedding a local stat function just
> for this purpose.

These days I seem to favor the separate method, but I see you've  
already provided a counter patch...

I can't see much problem either way, other than with the issues  
described in the comments by Daniel Pittman.

-- 
When a man sits with a pretty girl for an hour, it seems like a
minute. But let him sit on a hot stove for a minute, and it's longer
than any hour. That's relativity. --Albert Einstein
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to