Created
January 17, 2014 06:31
-
-
Save ranjib/8469300 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c = LXC::Container.new('foo') | |
c.create('ubuntu') | |
c.start | |
# we'll start tripping from here | |
reader, writer = IO.pipe | |
c.attach(wait: true) do | |
reader.close # its a process clone, so you have all the variable | |
x = Dir['/*'] | |
writer.write(Marshal.dump(x)) | |
end | |
writer.close | |
x = Marshal.load(reader.read) | |
reader.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment