如何删除应用程序目录中的文件? [英] How can you delete a file in the application directory?

查看:273
本文介绍了如何删除应用程序目录中的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在将日志文件写入File.applicationDirectory,并希望清除旧的日志文件。问题是如何从该目录中删除文件?当我尝试从这个目录中删除旧的日志文件时,它会给出安全异常。有没有反正呢?



我知道你不应该写入File.applicationDirectory,但我们正在写的是反正日志。所以,请不要只是说不要那样做!

谢谢,

Ryan

解决方案

File.applicationDirectory是一个只读目录。
$ b

http://livedocs.adobe.com/flex/3/langref/flash/filesystem /File.html


We are writing log files to File.applicationDirectory and want to clean out old log files. The question is how do you delete files out of that directory? When I try and delete old log files out of this directory it gives a security exception. Is there anyway around this?

I know you are not supposed to write to File.applicationDirectory, but we are writting are logs there anyways. So please don't just say don't do that!

Thanks,

Ryan

解决方案

File.applicationDirectory is a read only directory.

http://livedocs.adobe.com/flex/3/langref/flash/filesystem/File.html

这篇关于如何删除应用程序目录中的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆