D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
FileUtils
/
Filename :
link_entry-c.ri
back
Copy
U:RDoc::AnyMethod[iI"link_entry:ETI"FileUtils::link_entry;TT:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"RCreates {hard links}[https://en.wikipedia.org/wiki/Hard_link]; returns +nil+.;To:RDoc::Markup::BlankLine o; ; [I" Arguments +src+ and +dest+ ;TI"Kshould be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].;T@o; ; [I"?If +src+ is the path to a file and +dest+ does not exist, ;TI"5creates a hard link at +dest+ pointing to +src+:;T@o:RDoc::Markup::Verbatim; [ I"!FileUtils.touch('src0.txt') ;TI")File.exist?('dest0.txt') # => false ;TI"3FileUtils.link_entry('src0.txt', 'dest0.txt') ;TI"(File.file?('dest0.txt') # => true ;T:@format0o; ; [I"DIf +src+ is the path to a directory and +dest+ does not exist, ;TI"Irecursively creates hard links at +dest+ pointing to paths in +src+:;T@o;; [I"3FileUtils.mkdir_p(['src1/dir0', 'src1/dir1']) ;TI"src_file_paths = [ ;TI" 'src1/dir0/t0.txt', ;TI" 'src1/dir0/t1.txt', ;TI" 'src1/dir1/t2.txt', ;TI" 'src1/dir1/t3.txt', ;TI" ] ;TI"%FileUtils.touch(src_file_paths) ;TI"/File.directory?('dest1') # => true ;TI"+FileUtils.link_entry('src1', 'dest1') ;TI"/File.file?('dest1/dir0/t0.txt') # => true ;TI"/File.file?('dest1/dir0/t1.txt') # => true ;TI"/File.file?('dest1/dir1/t2.txt') # => true ;TI"/File.file?('dest1/dir1/t3.txt') # => true ;T; 0o; ; [I"Keyword arguments:;T@o:RDoc::Markup::List: @type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o; ; [I"S<tt>dereference_root: true</tt> - dereferences +src+ if it is a symbolic link.;To;;0; [o; ; [I"N<tt>remove_destination: true</tt> - removes +dest+ before creating links.;T@o; ; [I"PRaises an exception if +dest+ is the path to an existing file or directory ;TI"Iand keyword argument <tt>remove_destination: true</tt> is not given.;T@o; ; [I"3Related: FileUtils.ln (has different options).;T: @fileI"lib/fileutils.rb;T:0@omit_headings_from_table_of_contents_below000[ I"F(src, dest, dereference_root = false, remove_destination = false);T@GFI"FileUtils;TcRDoc::NormalModule00