A
Andrew Walrond
Am I doing something stupid?? ruby-doc says
"copy_entry(src, dest, preserve = false, dereference = false)
Copies a file system entry src to dest. This method preserves
file types, c.f. FIFO, device files, directory.…
Both of src and dest must be a path name. src must exist,
dest must not exist.
If preserve is true, this method preserves owner, group and
permissions. If dereference is true, this method copies a
target of symbolic link instead of a symbolic link itself. "
But I cannot get a symlink to copy as a symlink. Example:
andrew@orac apw $ ruby --version
ruby 1.8.2 (2004-12-15) [x86_64-linux]
andrew@orac apw $ ls -l /etc/ld.so.conf
lrwxrwxr-x 1 root root 27 Dec 16 23:28 /etc/ld.so.conf -> /pkg/glibc.1/etc/ld.so.conf
andrew@orac apw $ irb
irb(main):001:0> require "fileutils"
=> true
irb(main):002:0> FileUtils.copy_entry("/etc/ld.so.conf","ld.so.conf")
=> nil
irb(main):003:0> quit
andrew@orac apw $ ls -l
total 4
-rw-r--r-- 1 andrew users 2469 Jan 9 20:07 ld.so.conf
andrew@orac apw $
Any suggestions?
Andrew Walrond
"copy_entry(src, dest, preserve = false, dereference = false)
Copies a file system entry src to dest. This method preserves
file types, c.f. FIFO, device files, directory.…
Both of src and dest must be a path name. src must exist,
dest must not exist.
If preserve is true, this method preserves owner, group and
permissions. If dereference is true, this method copies a
target of symbolic link instead of a symbolic link itself. "
But I cannot get a symlink to copy as a symlink. Example:
andrew@orac apw $ ruby --version
ruby 1.8.2 (2004-12-15) [x86_64-linux]
andrew@orac apw $ ls -l /etc/ld.so.conf
lrwxrwxr-x 1 root root 27 Dec 16 23:28 /etc/ld.so.conf -> /pkg/glibc.1/etc/ld.so.conf
andrew@orac apw $ irb
irb(main):001:0> require "fileutils"
=> true
irb(main):002:0> FileUtils.copy_entry("/etc/ld.so.conf","ld.so.conf")
=> nil
irb(main):003:0> quit
andrew@orac apw $ ls -l
total 4
-rw-r--r-- 1 andrew users 2469 Jan 9 20:07 ld.so.conf
andrew@orac apw $
Any suggestions?
Andrew Walrond