Skip to content

Instantly share code, notes, and snippets.

require 'ffi'
module ChdirExec
extend FFI::Library
ffi_lib 'c'
attach_function :execlp, [:string, :varargs], :int
attach_function :chdir, [:string], :int
def self.chdir_exec(dir, cmd, *argv)