|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-06-22 23:30 UTC] marsell_tyka at yahoo dot co dot id
[2010-06-22 23:42 UTC] marsell_tyka at yahoo dot co dot id
[2010-06-23 02:05 UTC] kalle@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: kalle
[2010-06-23 12:01 UTC] bjori@php.net
-Status: Closed
+Status: Bogus
[2010-10-22 14:19 UTC] kalle@php.net
-Assigned To: kalle
+Assigned To:
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 07:00:01 2025 UTC |
Description: ------------ copylink reads the filename linked to by the argument and replaced the link with a copy of the file. It opens a filehandle to read from the link, deletes the link, and then copies the filehandle back to the link. safecopylink does the same as copylink but without the open-and-delete manouvre. Instead, it uses File::Spec::Link to find the target of the link and copies from there. This module is mostly a wrapper round File::Spec::Link::linked and File::Copy::copy, the functionality is available in a command line script copylink. EXPORT Nothing by default, can export copylink, `safecopylink. Test script: --------------- File::Copy::rmscopy Expected result: ---------------- copy("file1", "tmp"); # creates the file 'tmp' in the current directory copy("file1", ":tmp:"); # creates :tmp:file1 copy("file1", ":tmp"); # same as above copy("file1", "tmp"); # same as above, if 'tmp' is a directory (but don't do # that, since it may cause confusion, see example #1) copy("file1", "tmp:file1"); # error, since 'tmp:' is not a volume copy("file1", ":tmp:file1"); # ok, partial path copy("file1", "DataHD:"); # creates DataHD:file1 move("MacintoshHD:fileA", "DataHD:fileB"); # moves (doesn't copy) files from one # volume to another Actual result: -------------- copy("file1", "tmp"); # creates the file 'tmp' in the current directory copy("file1", ":tmp:"); # creates :tmp:file1 copy("file1", ":tmp"); # same as above copy("file1", "tmp"); # same as above, if 'tmp' is a directory (but don't do # that, since it may cause confusion, see example #1) copy("file1", "tmp:file1"); # error, since 'tmp:' is not a volume copy("file1", ":tmp:file1"); # ok, partial path copy("file1", "DataHD:"); # creates DataHD:file1 move("MacintoshHD:fileA", "DataHD:fileB"); # moves (doesn't copy) files from one # volume to another