Skip to content

Instantly share code, notes, and snippets.

@jberkel
Forked from headius/gist:111495
Created May 14, 2009 10:26
Show Gist options
  • Save jberkel/111609 to your computer and use it in GitHub Desktop.
Save jberkel/111609 to your computer and use it in GitHub Desktop.
require 'ffi'
module Exec
extend FFI::Library
attach_function :my_exec, :execl, [:string, :string, :varargs], :int
attach_function :fork, [], :int
end
vim1 = '/usr/bin/vim'
vim2 = 'vim'
if Exec.fork == 0
Exec.my_exec vim1, vim2, :pointer, nil
end
Process.waitall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment