AIR 中的 File 对象 所访问的文件夹位置
AIR 中的 File 对象 所访问的文件夹位置




关于File.cacheDirectory的一点说明
According to the Apple guidelines, data that can be downloaded again or regenerated shall be stored in the <APPLICATION_HOME>/Library/Caches directory.
So, with AIR 3.6, a new static property, File.cacheDirectory has been introduced, which points to this directory. Files stored in this directory are not backed up on the iCloud.
Examples of files you should put in the Caches directory include database cache files and downloadable content, such as that used by magazine, newspaper, and map applications.
On Mac OSX and Android, File.cacheDirectory points to the Caches directory ( <APPLICATION_HOME>/Library/Caches on Mac and <APPLICATION_HOME>/caches directory on Android). While on Windows, it points to the parent directory being used by File.createTempDirectory.
var myCacheFile: File = File.cacheDirectory.resolvePath("cacheFile.txt");
There can be cases when a file or directory is required to be stored in a directory other than <APPLICATION_HOME>/Library/Caches directory, but still not required to be backed up on the iCloud, eg. files stored in the application storage directory. To address this issue, another property, preventBackup has been added to the File API. The default value of this property is false on all platforms and can be set to true only on iOS. When the property is set to true for a File object on iOS, the file/directory corresponding to that File object is not backed up on the iCloud. If the File object points to a directory on iOS, all files in that directory are not backed up (irrespective of the values of preventBackup for individual files/sub-directories of that directory). This property works on iOS 5.1 devices and later and does not work on the iOS Simulator. Files stored in APP_HOME/tmp/ or APP_HOME/Library/Caches directory are not backed up, irrespective of the value set for this property. On querying the value of preventBackup for a particular File object, the last set value of preventBackup or false (the default value) will be returned on iOS and all other platforms will continue to return false, even if explicitly set to true.
var file: File = File.applicationStorageDirectory.resolvePath("abc.txt");
file.preventBackup = true;
The above properties will only work for application descriptor namespace 3.6 (or greater) and SWF version greater than 19.
AIR 中的 File 对象 所访问的文件夹位置的更多相关文章
- 在linux和Mac中访问某个文件夹中所有的文件
在linux和Mac中访问某个文件夹中所有的文件——输出所有的文件名 #include <stdio.h> #include <dirent.h> int main() { s ...
- Path,Files巩固,题目:从键盘接收两个文件夹路径,把其中一个文件夹中(包含内容)拷贝到另一个文件夹中
这个题目用传统的File,InputStream可以做,但是如果用Files,Path类做,虽然思路上会困难一些,但是代码简洁了很多,以下是代码: import java.io.IOException ...
- windwo访问linux文件夹方法
windwo访问linux文件夹:是通过linux的samba来实现的: 安装samba需要安装samba-client.samba-common.smaba3个包. 一:安装rpm 现有一个服务器l ...
- node静态资源服务器的搭建----访问本地文件夹(搭建可访问静态文件的服务器)
我们的目标是实现一个可访问静态文件的服务器,即可以在浏览器访问文件夹和文件,通过点击来查看文件. 1.先创建一个文件夹anydoor,然后在该文件夹里npm init一个package.json文件, ...
- AD域-让共享目录只显示用户有权限访问的文件夹
问题: 在AD域中,我们一般都会用到共享,如果有很多部门,我们可能还会按部门.职位配置权限.比如CSD,IT,PA等,但文件夹一多,用户看着就头大,而且用户没权限访问的文件夹误点击进去还会提示无权限访 ...
- FTP文件夹打开错误,Windows无法访问此文件夹
错误提示: Windows 无法访问此文件夹,请确保输入的文件夹是正确的,并且你有权访问此文件夹. 解决方法/步骤如下 1.请确保输入的文件夹是正确的,并且你有权访问此文件夹.可以在浏览器 ...
- [置顶] 如何访问web文件夹之外的文件
在编写项目时,遇到一个如何访问web文件夹之外的文件的问题.因为我要制作一个浏览图片和pdf文件的一个简单网站.但问题是图片的文件夹和pdf文件的文件夹都是其他程序生成的,自然也就是不是网站w ...
- 使用javascript来访问本地文件夹
常用的.net 的aspx文件由于运行在服务器端,并不具有访问用户本地文件夹的权限,导致类似于<a href="file:///d:/backup" > open fo ...
- vue-cli中自定义路径别名 assets和static文件夹的区别
转自:vue-cli中自定义路径别名 assets和static文件夹的区别 静态资源处理: assets和static文件夹的区别 相信有很多人知道vue-cli有两个放置静态资源的地方,分别是sr ...
随机推荐
- Java中instanceof用法
java 中的instanceof 运算符是用来在运行时指出对象是否是特定类的一个实例.instanceof通过返回一个布尔值来指出,这个对象是否是这个特定类或者是它的子类的一个实例. 用法:resu ...
- Qt中sleep()的实现(耳目一新的两种方法)
在Qt中并没有Sleep函数可以调用,在程序编写时往往需要休眠几秒,这里举出两个方法,不知道是否啥不良隐患没~~ 方法一: class SleeperThread : public QThread{p ...
- Windows创建文件链接
Windows平台创建文件.文件夹链接: 测试平台,windows10. D:\>mklink 创建符号链接. MKLINK [[/D] | [/H] | [/J]] Link Target / ...
- C#访问url地址并返回数据
public partial class Form1 : Form { static bool isSelect = false; public Form1() { InitializeCompone ...
- node.js事件触发
var events = require('events'); var EventEmitter = events.EventEmitter(); //监听这个名为TestE事件 EventEmitt ...
- css spprite应用
(一)实现简单的淘宝带图标侧边栏效果 <!DOCTYPE html> <html lang="en"> <head> <meta char ...
- JavaScipt选取文档元素的方法
摘自JavaScript权威指南(jQuery根据样式选择器查找元素的终极方式是 先用getElementsByTagName(*)获取所有DOM元素,然后根据样式选择器对所有DOM元素进行筛选) 选 ...
- iOS _BSMachError: (os/kern) invalid capability (20)
_BSMachError: (os/kern) invalid capability (20) 解决办法:将info.plist里面的en改为United States 2016-04-18 22:4 ...
- Selenium2学习-013-WebUI自动化实战实例-011-WebElement.getText()值为空问题探索及解决
今天有个朋友在群里问 WebElement.getText() 值为空,当你发现取到的值为空的时候,会不会郁闷呢?明明看到的值不为空,脚本看着也没有问题啊,为何取到的值为空呢!!!万千纠结啊,若是长时 ...
- iis7.5应用程序池模板永久性缓存初始化失败解决方法
错误: 针对应用程序池的模板永久性缓存初始化失败,这是由以下错误导致的: 无法为应用程序池创建磁盘缓存子目录.数据可能包含其他错误代码. 解决办法如下: 网上搜索的答案全都是修改3个目录的权限,给II ...