1个字节文件中存储了哪些类型的内容?
Tanenbaum的现代操作系统的第301页包含下表。它在2005年商业Web服务器上提供了文件大小。本章是在文件系统上,因此这些数据点的目的是与您在典型的存储设备上看到的相似。
文件长度(字节) | 文件的百分比小于长度 |
---|---|
1 | 6.67 |
2 | 7.67 |
4 | 8.33 |
8 | 11.30 |
16 | 11.46 |
32 | 12.33 |
64 | 26.10 |
128 | 28.49 |
... | ... |
1KB | 47.82 |
... | ... |
1 Mb | 98.99 |
... | ... ... |
128 MB | 100 |
在表中,您会看到该服务器上6.67%的文件长度为1个字节。哪些过程创建1个字节文件?这些文件将存储什么样的数据?
Page 301 of Tanenbaum's Modern Operating Systems contains the table below. It gives the file sizes on a 2005 commercial Web server. The chapter is on file systems, so these data points are meant to be similar to what you would see on a typical storage device.
File length (bytes) | Percentage of files less than length |
---|---|
1 | 6.67 |
2 | 7.67 |
4 | 8.33 |
8 | 11.30 |
16 | 11.46 |
32 | 12.33 |
64 | 26.10 |
128 | 28.49 |
... | ... |
1KB | 47.82 |
... | ... |
1 MB | 98.99 |
... | ... |
128 MB | 100 |
In the table, you will see that 6.67% of files on this server are 1 byte in length. What kinds of processes are creating 1 byte files? What kind of data would be stored in these files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不熟悉那张桌子,但这引起了我的兴趣。我不确定当时的1个字节文件是什么,但是今天的1字节文件也许可以散发出一些灯光吗?
我搜索了Size 1 Byte的文件,并
查看系统上这些文件的内容,它们包含一个字符:newline。可以通过通过hexdump运行文件来验证这一点。具有单个newline的文件可能存在多种原因,但这可能与用newline终止一条线的约定。
有第二种类型的文件,其中大小为1个字节:目标是单个字符的符号链接。 EXT4似乎将目标的长度报告为符号链接的大小(至少对于短长目标)。
I wasn't familiar with that table, but it piqued my interest. I'm not sure what the 1-byte files were at the time, but perhaps the 1-byte files of today can shed some light?
I searched for files of size 1 byte with
Looking at the contents of these files on my system, they contain a single character: a newline. This can be verified by running the file through hexdump. A file with a single newline can exist for multiple reasons, but it probably has to do with the convention of terminating a line with a newline.
There is a second type of file with size 1 byte: symbolic links where the target is a single character. ext4 appears to report the length of the target as the size of the symbolic link (at least for short-length targets).