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.

Thoughts?

-- Markus



--~--~---------~--~----~------------~-------~--~----~
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