Android中的本地存储路径



Context.getCacheDir()

/data/data/cache
These files will be ones that get deleted first when the device runs low on storage. There is no guarantee when these files will be deleted.
但是,最好不要依赖系统来管理,应该自己设定一个最大容量,当超出这个值时自己删除。


Context.getFilesDir(),Context.openFileOutput(String, int),Context.getFileStreamPath(String),Context.getDir(String, int)
/data/data/files
Android支持在SD卡上的应用私有目录,在Froyo版本后,通过getExternalFilesDir()可以获得具体路径。该路径依赖与应用的包名,如果你包为hello.file那么SD开上的应用私有目录为\mnt\sdcard\Android\data\hello.file\files\.
在使用SD卡目录时,需注意SD卡是否挂载,可通过Environment.getExternalStorageState()方法进行判断,如果返回值为Envirnment.MEDIA_MOUNTED表示SD卡处于挂载状态,可以放心使用。


getExternalCacheDir()和getCacheDir()比较
共同点:
files will be deleted when the application is uninstalled
不同点:
1、The platform does not monitor the space available in external storage, and thus will not automatically delete these files. Note that you should be managing the maximum space you will use for these anyway, just like with getCacheDir().
2、External files are not always available: they will disappear if the user mounts the external storage on a computer or removes it. See the APIs on Environment for information in the storage state.
3、There is no security enforced with these files. All applications can read and write files placed here.
FTP服务器默认目录 FTP命令是Internet用户使用最频繁的命令之一,不论是在DOS还是UNIX操作系统下使用FTP,都会遇到大量的FTP内部命令。熟悉并灵活应用FTP的内部命令,可以大大方便使用者,并收到事半功倍之效。 FTP的命令行格式为:ftp -v -d -i -n -g [主机名],其中 -v显示远程服务器的所有响应信息; -n限制ftp的自动登录,即不使用; .n etrc文件; -d使用调试方式; -g取消全局文件名。 ftp使用的内部命令如下(中括号表示可选项): 1.![cmd[args]]:在本地机中执行交互shell,exit回到ftp环境,如:!ls*.zip. 2.$ macro-ame[args]:执行宏定义macro-name. 3.account[password]:提供登录远程系统成功后访问系统资源所需的补充口令。 4.append local-file[remote-file]:将本地文件追加到远程系统主机,若未指定远程系统文件名,则使用本地文件名。 5.ascii:使用ascii类型传输方式。 6.bell:每个命令执行完毕后计算机响铃一次。 7.bin:使用二进制文件传输方式。 8.bye:退出ftp会话过程。 9.case:在使用mget时,将远程主机文件名中的大写转为小写字母。 10.cd remote-dir:进入远程主机目录。 11.cdup:进入远程主机目录的父目录。 12.chmod mode file-name:将远程主机文件file-name的存取方式设置为mode,如:chmod 777 a.out。 13.close:中断与远程服务器的ftp会话(与open对应)。 14.cr:使用asscii方式传输文件时,将回车换行转换为回行。 15.delete remote-file:删除远程主机文件。 16.debug[debug-value]:设置调试方式,显示发送至远程主机的每条命令,如:deb up 3,若设为0,表示取消debug。 17.dir[remote-dir][local-file]:显示远程主机目录,并将结果存入本地文件local-file。 18.disconnection:同close。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值