Skip to content

Commit 94a599e

Browse files
Clarify difference between cp_r and install (#95)
1 parent 42c9685 commit 94a599e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/fileutils.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# - {Setting}[rdoc-ref:FileUtils@Setting].
2525
# - {Comparing}[rdoc-ref:FileUtils@Comparing].
2626
# - {Copying}[rdoc-ref:FileUtils@Copying].
27-
# - {Moving}[rdoc-ref:FileUtils@Copying].
27+
# - {Moving}[rdoc-ref:FileUtils@Moving].
2828
# - {Options}[rdoc-ref:FileUtils@Options].
2929
#
3030
# === Creating
@@ -76,8 +76,9 @@
7676
# - ::copy_stream: Copies a stream.
7777
# - ::cp, ::copy: Copies files.
7878
# - ::cp_lr: Recursively creates hard links.
79-
# - ::cp_r: Recursively copies files.
80-
# - ::install: Recursively copies files (with options different from ::cp_r).
79+
# - ::cp_r: Recursively copies files, retaining mode, owner, and group.
80+
# - ::install: Recursively copies files, optionally setting mode,
81+
# owner, and group.
8182
#
8283
# === Moving
8384
#
@@ -835,6 +836,9 @@ def cp(src, dest, preserve: nil, noop: nil, verbose: nil)
835836
# and +dest+ (a single path)
836837
# should be {interpretable as paths}[rdoc-ref:FileUtils@Path+Arguments].
837838
#
839+
# The mode, owner, and group are retained in the copy;
840+
# to change those, use FileUtils.install instead.
841+
#
838842
# If +src+ is the path to a file and +dest+ is not the path to a directory,
839843
# copies +src+ to +dest+:
840844
#

0 commit comments

Comments
 (0)