使用php脚本在windows上复制图像而不修改创建日期
我创建了一个小php脚本,在Windows中按文件夹/日期对图片进行分类。 一切都很好,文件放在了好地方,但它改变了我的“创建日期”,我想保持原封不动 我使用了一个非常简单的php copy()函数 我使用了touch()+filectime,但仍然无法更改文件的创建日期 有什么想法吗?来自php.net:使用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
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()代码>而不是<代码>复制()代码>复制文件,重命名并移动文件。