Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用php脚本在windows上复制图像而不修改创建日期_Php_Windows - Fatal编程技术网

使用php脚本在windows上复制图像而不修改创建日期

使用php脚本在windows上复制图像而不修改创建日期,php,windows,Php,Windows,我创建了一个小php脚本,在Windows中按文件夹/日期对图片进行分类。 一切都很好,文件放在了好地方,但它改变了我的“创建日期”,我想保持原封不动 我使用了一个非常简单的php copy()函数 我使用了touch()+filectime,但仍然无法更改文件的创建日期 有什么想法吗?来自php.net: It's worth noting that copy() sets the destination file's last modified time/date. 使用这个有什么问题 c

我创建了一个小php脚本,在Windows中按文件夹/日期对图片进行分类。 一切都很好,文件放在了好地方,但它改变了我的“创建日期”,我想保持原封不动

我使用了一个非常简单的php copy()函数

我使用了touch()+filectime,但仍然无法更改文件的创建日期

有什么想法吗?

来自php.net:

It's worth noting that copy() sets the destination file's last modified time/date.
使用这个有什么问题

clearstatcache();
$oldstamp = filemtime("file.txt");
copy("file.txt","newfolder/file.txt");
touch("newfolder/file.txt",$oldstamp);

我仍然在寻找一种从php更改创建日期的方法。然后用Picasa wich查看我的图库,并读取创建日期。是否检查了我的代码?filemtime(m而不是c)和clearstatcache?是的,我做了,但是touch()仍然只影响我不需要的:)为什么不试试
rename()而不是<代码>复制()复制文件,重命名并移动文件。