EventMachine FileUtils

em-file-utils allows base file operations using UNIX commands such as standard library FileUtils, but returns CommandBuilder objects which allows wide customizations to final call and asynchronous evented EventMachine interface support (although it isn't required). UNIX/GNU based systems only are supported.

Some example:

# synchronous
require "em-file-utils"
output = EM::FileUtils::touch("./~test1").execute!

# asynchronous
EM::run   # eventmachine
    EM::FileUtils::touch("./~test1").execute do |output|
        # ...
    end
end

It returns CommandBuilder object which allows it to be flexible:

cmd = EM::FileUtils::touch("./~test1")
cmd.params.unshift(:a)      # change access time only 
cmd.execute!

Copyright © 2011 – 2015 Martin Poljak. See LICENSE.txt for further details.