method
ln
v2_2_9 -
Show latest stable
-
0 notes -
Class: FileUtils
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378 (0)
- 1_9_2_180 (0)
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6 (-38)
- 2_5_5 (0)
- 2_6_3 (0)
- What's this?
ln(src, dest, options = {})
public
Options: force noop verbose
Creates a hard link new which points to old. If new already exists and it is a directory, creates a link new/old. If new already exists and it is not a directory, raises Errno::EEXIST. But if :force option is set, overwrite new.
FileUtils.ln 'gcc', 'cc', :verbose => true FileUtils.ln '/usr/bin/emacs21', '/usr/bin/emacs'
ln(list, destdir, options = {})
Creates several hard links in a directory, with each one pointing to the item in list. If destdir is not a directory, raises Errno::ENOTDIR.
include FileUtils cd '/sbin' FileUtils.ln %w(cp mv mkdir), '/bin' # Now /sbin/cp and /bin/cp are linked.