php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52150 salam purwokerto
Submitted: 2010-06-22 23:08 UTC Modified: 2010-10-22 14:19 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: marsell_tyka at yahoo dot co dot id Assigned:
Status: Not a bug Package: Website problem
PHP Version: 5.3SVN-2010-06-22 (snap) OS: File::Copy::syscopy
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
45 - 1 = ?
Subscribe to this entry?

 
 [2010-06-22 23:08 UTC] marsell_tyka at yahoo dot co dot id
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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-22 23:30 UTC] marsell_tyka at yahoo dot co dot id
pleace help me..........
 [2010-06-22 23:42 UTC] marsell_tyka at yahoo dot co dot id
why....
 [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:
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 16:01:29 2024 UTC