Bug #47758 [Fbk->NoF]: copy() may result in data loss

From: Date: Sun, 14 Aug 2016 04:22:24 +0000
Subject: Bug #47758 [Fbk->NoF]: copy() may result in data loss
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203250@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=47758&edit=1

 ID:               47758
 Updated by:       php-bugs@lists.php.net
 Reported by:      nosp at m dot net
 Summary:          copy() may result in data loss
-Status:           Feedback
+Status:           No Feedback
 Type:             Bug
 Package:          Filesystem function related
 Operating System: Debian 64
 PHP Version:      5.2.9
 Assigned To:      cmb
 Private report:   N

 New Comment:

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.


Previous Comments:
------------------------------------------------------------------------
[2016-08-03 16:26:44] cmb@php.net

> leave somefile unaltered

Actually, this is supposed to happen after bug #32160 had been
fixed. And I can't reproduce the described behavior under Debian
Jessie x64 (with none of the supported PHP versions). So if this
issue still persists for you, we need more information.

Anyhow, what you have described would be a bug (not an
improvement).

------------------------------------------------------------------------
[2009-03-24 13:15:06] nosp at m dot net

Description:
------------
copying a large file to itself result in a 64ko truncated file

Reproduce code:
---------------
$somepath = [path_to_a_file];
copy($somepath, $somepath);

Expected result:
----------------
leave somefile unaltered

Actual result:
--------------
on Debian 64-bit (not on OS X Leopard), any file > 64ko copied to itself result in a 64ko file.
i suppose that's because it copies files by 64ko blocks and writes block per block so after the
first block copy, the source is 64ko length.
as it can result in data loss and copying a file to itself should do nothing, i propose to raise a
warning and do nothing when copy has the same path for source and dest.


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=47758&edit=1


Thread (3 messages)

« previous php.bugs (#203250) next »