没有剩余空间设备,但SD卡没有满 [英] No space left on device but SD card not full

查看:177
本文介绍了没有剩余空间设备,但SD卡没有满的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Andr​​oid应用程序,它会下载从谷歌文档文件到SD卡上的设备。 (原因:有PDF-S,我不能应用程序中打开)结果。
直到我得到10000总共〜第八千文件时,它成功地写入SD卡。

I have android app which downloads files from google docs to SD card on device. (reason: have PDF-s which I cannot open within app).
It writes successfully to SD card until I get to ~8000th file of 10000 total.

code用于写入SD:

Code for writing to SD:

InputStream is = response.getContent();
FileOutputStream fos = new FileOutputStream(new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/"+preferences.getString("username", "manas11")+"/" + tmp_entry.resourceID.replace(":","~_~")+"~_~"+tmp_entry.title));
byte[] buf = new byte[1024];
int len;
while((len=is.read(buf))>0)
    fos.write(buf,0,len);

例外一行2抛出:

Exception thrown by line 2:

java.io.FileNotFoundException: /mnt/sdcard/matulic.realestate.hr/file~_~0B3n2EnTf5ATnYTJkNTNmM2QtZDJjYy00YjNhLWJlZjQtYTE4MTU5MjI2N2E5~_~Kuæa Marina Sevid 399.00 m2 - LJETNA AKCIJA IZVRSN - k359.txt (No space left on device)

格式化SD卡的microSD™存储卡(SD 2.0兼容),8GB,FAT32。即时通讯使用的Desire HD。结果
正如你所看到的文件名很长。
我将文件保存到目录到/ mnt / SD卡/该状态之后,例外的是(按天文):结果
大小:519668573字节结果
文件数:8037结果
设备免费大小:4.91摹

SD card is microSD™ memory card (SD 2.0 compatible), 8gb, FAT32 formatted. Im using Desire HD.
As you can see filenames are long. I save files to directory in /mnt/sdcard/ which state after exception is (by Astro):
size: 519,668,573 bytes
number of files: 8037
device free size: 4.91 G

有没有写SD我不知道任何限制?结果
谢谢

Is there any limit for writing to SD I dont know about?
Thank you

推荐答案

我相信这个计算器问题将回答你的问题。

I believe this stackoverflow question will answer your question.

<一个href=\"http://stackoverflow.com/questions/2651907/is-there-a-limit-for-the-number-of-files-in-a-directory-on-an-sd-card\">Is那里的文件在SD卡上的目录中的数量限制?

我还检查了一些资料自己,并发现它基本上归结为在文件数和文件名的长度有限制。从我在链接中引用上述 HTTP微软文档中读到:// msdn.microsoft.com/en-us/windows/hardware/gg463080.aspx~~V 你有你的文件名长度的问题。

I also checked out some of the information myself and found it basically comes down to a limit in the number of files and the length of the file name. From what I read in the Microsoft document referenced in the link above http://msdn.microsoft.com/en-us/windows/hardware/gg463080.aspx you have a problem with the length of your file names.

首先是你的文件名的长度。长文件名占用更多的空间。有在目录65,536 32字节的条目的限制。这是因为一个目录文件容器的最大尺寸为2,097,152字节(65536 * 32)。但是,如果你的文件名是超过8.3更长,他们将需要更多的不仅仅是一个条目。还长文件名,占用更多的空间比自己的角色的简单相加。有开销创建之类的校验和与它一起去很短的8.3文件名的文件系统。

First is the length of your file names. Longer file names take up more space. There is a limit of 65,536 32 byte entries in the directory. This is because the maximum size of a directory file container is 2,097,152 bytes (65536*32). However, if your file names are longer than 8.3 they will take up more than just one entry. Also long file names take up more space than simply the sum of their characters. There is overhead to the filesystem that creates things like checksums and a short 8.3 file name to go along with it.

最好的建议将大大缩短文件名,并应解决您的问题。

Best advice would be to shorten the file names dramatically and that should solve your problem.

希望这有助于。

这篇关于没有剩余空间设备,但SD卡没有满的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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