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. PHP学习(五)----jQuery和JSON数据

    对于jQuery: jQuery 是一个 JavaScript 库. jQuery 极大地简化了 JavaScript 编程.

  2. docker安装与启动

    安装docker [root@localhost /]# yum -y install docker-io     更改配置文件 [root@localhost /]# vi /etc/sysconf ...

  3. WIN7 64位系统下的服务程序更新失败问题解决

    自己用DELPHI做了个小的服务在后台运行,帮助自己做一些琐事,今天修改了一下代码结果重启服务的时候一直还是以前的状态,新加的代码没任何效果. 1.检查程序没问题呀 2.关闭SSD缓存硬盘问题仍旧 3 ...

  4. JAVA的覆盖、继承和多态的详细解说.this和super的用法

    1. 继承: (1)子类的构造方法一定会调用父类的构造方法. (2)任何子类构造方法第一行肯定是this();或者super();两个择一. this();调用本类的其它构造方法.(传递相应参数调用相 ...

  5. 阻止默认行为stopDefault

    function stopDefault(e){ if(e && e.preventDefault) e.preventDefault(); else window.event.ret ...

  6. mysql 数据库封装类:返回索引、关联、字符串数组;分页查询封装类 :$page=new Page(表的总条数,每页的条数);$sql = "".$page->limit; echo $page->fpage();

    <?php class czy { public $host="localhost"; //地址 public $uid="root"; //用户名 pu ...

  7. 使用多种客户端消费WCF RestFul服务(四)——Jquery篇

    Jquery篇 互联网开发中少不了各类前端开发框架,其中JQUERY就是最流行之一,本篇我们就采用JQUERY来消费WCF RestFul服务,其中用到JSON基础知识,如果有想了解的朋友,请访问:& ...

  8. The All-purpose Zero---hdu5773(LIS变形)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5773 题意: 给出n个数,其中 0 可当作任何数,求能够得到的最长上升子序列(严格上升)的长度; 我们 ...

  9. SQL学习笔记 SQL ORDER BY 关键字

    SELECT column_name,column_nameFROM table_nameORDER BY column_name,column_name ASC|DESC; SELECT id, n ...

  10. ajax 调用asp.net后台方法

    ajax 调用asp.net后台方法  这种做法有好几种,如调用xx.asxh 页面,或者直接调用xx.aspx也面,在page_Load中进行一些判断然后调用后面的其他方法, 或者你可以直接调用we ...