首页  >  文章  >  后端开发  >  php使用copy()拷备文件的一个有关问题

php使用copy()拷备文件的一个有关问题

WBOY
WBOY原创
2016-06-13 12:25:57795浏览

php使用copy()拷备文件的一个问题
请问各位大师,我在使用php的copy()拷备文件
$file  =  'd:/temp/example.txt' ;
$newfile  =  'e:/example.txt' ;

if (! copy ( $file ,  $newfile )) {
    echo  "failed to copy  $file ...\n" ;
}
?> 
拷备后的文件的时间为完成拷备的时间,而我希望拷备后的文件时间与原文件一样,不知如何处理。
请大师们指点。
------解决思路----------------------

touch($newfile, filectime($file));

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn