Hi all,

So, I'm trying to resolve an annoying issue related to printing change  
information for file contents, and I'm realizing that I probably deal  
with file content more often than I should.  Which is to say, I should  
probably *never* load a file's content into memory unless I need to  
write it to disk, and hopefully soon I'll be able to avoid doing that,  
too.

Is it reasonable to just calculate a file's checksum and never  
actually deal with the content directly (except as we need to to write  
it to disk)?

For example, here's 'retrieve' right now:

         def retrieve
             ....
             begin
                 return File.read(@resource[:path])
             rescue => detail
                 raise Puppet::Error, "Could not read %s: %s" %  
[[email protected], detail]
             end
         end

Instead, we'd return the checksum, rather than the file content.

The upside here is that we'd never have this content in memory unless  
we absolutely needed it, but the downside is that Puppet as a  
framework would essentially be incapable of returning a file's content  
through normal usage.

Of course, it's not actually possible now -- you ask about a file, and  
it uses the content internally, but all you ever see is a checksum.

-- 
I wanna hang a map of the world in my house. Then I'm gonna put pins
into all the locations that I've traveled to. But first, I'm gonna
have to travel to the top two corners of the map so it won't fall
down. -- Mitch Hedberg
---------------------------------------------------------------------
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