[英]Perl LWP::Simple::getstore How to check if the file exists in destination directory
In my Perl script I am using LWP::Simple::getstore
to retrieve an image and store as file. 在我的Perl脚本中,我使用
LWP::Simple::getstore
检索图像并将其存储为文件。 But before storing how to check if that file already exists? 但是在存储之前如何检查该文件是否已经存在?
this is the snippet 这是片段
use constant FILE_DIR => "/home/destination/files/";
my $image_path = FILE_FOLDER."$item_id"."_"."$file_date.$image";
my $res = LWP::Simple::getstore($image_url,$image_path);
Please help me with this. 请帮我解决一下这个。
Thanks 谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.