gpt4 book ai didi

actionscript-3 - 如何检查文件是否存在?

转载 作者:行者123 更新时间:2023-12-01 19:28:50 25 4
gpt4 key购买 nike

我正在使用Flash CS5并为iOS开发。我也在使用应用程序存储目录。但是,在我的代码中,试图在创建存储目录中的文件之前先读取该文件,因此会导致错误。如何首先检查文件是否存在?

最佳答案

flash docs:

import flash.filesystem.*;

var temp:File = File.createTempFile();
trace(temp.exists); // true
temp.deleteFile();
trace(temp.exists); // false

关于actionscript-3 - 如何检查文件是否存在?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4717726/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com