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

Link

关于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 对象 所访问的文件夹位置的更多相关文章

  1. 在linux和Mac中访问某个文件夹中所有的文件

    在linux和Mac中访问某个文件夹中所有的文件——输出所有的文件名 #include <stdio.h> #include <dirent.h> int main() { s ...

  2. Path,Files巩固,题目:从键盘接收两个文件夹路径,把其中一个文件夹中(包含内容)拷贝到另一个文件夹中

    这个题目用传统的File,InputStream可以做,但是如果用Files,Path类做,虽然思路上会困难一些,但是代码简洁了很多,以下是代码: import java.io.IOException ...

  3. windwo访问linux文件夹方法

    windwo访问linux文件夹:是通过linux的samba来实现的: 安装samba需要安装samba-client.samba-common.smaba3个包. 一:安装rpm 现有一个服务器l ...

  4. node静态资源服务器的搭建----访问本地文件夹(搭建可访问静态文件的服务器)

    我们的目标是实现一个可访问静态文件的服务器,即可以在浏览器访问文件夹和文件,通过点击来查看文件. 1.先创建一个文件夹anydoor,然后在该文件夹里npm init一个package.json文件, ...

  5. AD域-让共享目录只显示用户有权限访问的文件夹

    问题: 在AD域中,我们一般都会用到共享,如果有很多部门,我们可能还会按部门.职位配置权限.比如CSD,IT,PA等,但文件夹一多,用户看着就头大,而且用户没权限访问的文件夹误点击进去还会提示无权限访 ...

  6. FTP文件夹打开错误,Windows无法访问此文件夹

    错误提示: Windows 无法访问此文件夹,请确保输入的文件夹是正确的,并且你有权访问此文件夹.    解决方法/步骤如下    1.请确保输入的文件夹是正确的,并且你有权访问此文件夹.可以在浏览器 ...

  7. [置顶] 如何访问web文件夹之外的文件

        在编写项目时,遇到一个如何访问web文件夹之外的文件的问题.因为我要制作一个浏览图片和pdf文件的一个简单网站.但问题是图片的文件夹和pdf文件的文件夹都是其他程序生成的,自然也就是不是网站w ...

  8. 使用javascript来访问本地文件夹

    常用的.net 的aspx文件由于运行在服务器端,并不具有访问用户本地文件夹的权限,导致类似于<a href="file:///d:/backup" > open fo ...

  9. vue-cli中自定义路径别名 assets和static文件夹的区别

    转自:vue-cli中自定义路径别名 assets和static文件夹的区别 静态资源处理: assets和static文件夹的区别 相信有很多人知道vue-cli有两个放置静态资源的地方,分别是sr ...

随机推荐

  1. 开班典礼-老师玩命的教,大家玩命的学,沉静,18K

    接下来的四个月决定我的命运,三年前决定现在,现在决定三年后.喜讯,双元安卓四期,1368$,到第二期仍然不成熟,打分意见多写, 孙健:15011386618 喊出你 的目标.自己监督不了自己,别人可能 ...

  2. Static Random-Access Memory Dynamic Random-Access Memory

    COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION RAM technology is div ...

  3. Java单链表的实现

    将结点Node进行封装,假设Node的操作有增加,删除,查找,打印几个操作.将Node实现为链表Link的内部类,简化代码. package Chapter5; import java.securit ...

  4. Fortran并行计算的一些例子

    以下例子来自https://computing.llnl.gov/tutorials/openMP/exercise.html网站 一.打印线程(Hello world) C************* ...

  5. 捕获JS 错误日志

    最近在做项目的过程中,发现很多JS报错没有引起重视,我就想想把JS错误捕获了,然后展示在我们一个平台上 具体实现代码: window.onerror = function(message, url,  ...

  6. 使用Reveal

    添加Reveal.framework,设置Other link flags 添加Debug为 -ObjC,添加 libz 库 这里介绍 Reveal UI 分析工具的简单使用,至于使用他分析手机 Ap ...

  7. FTS抓包看蓝牙的SDP整个过程

    1.概述   SDP是蓝牙的Service Discovery Protocol,用来发现远程设备能够提供的Service.它只负责发现对方支持的Service,不负责Service的具体实现.   ...

  8. 自己写的一个DirectUI库,基础控件基本都已实现

    http://download.csdn.net/detail/pcradio/9254881 http://blog.csdn.net/pcradio

  9. IIS Express启动命令

    http://www.iis.net/learn/extensions/using-iis-express/running-iis-express-from-the-command-line C:\P ...

  10. iOS _BSMachError: (os/kern) invalid capability (20)

    _BSMachError: (os/kern) invalid capability (20) 解决办法:将info.plist里面的en改为United States 2016-04-18 22:4 ...