1个字节文件中存储了哪些类型的内容?

发布于 2025-02-02 17:04:18 字数 846 浏览 5 评论 0原文

Tanenbaum的现代操作系统的第301页包含下表。它在2005年商业Web服务器上提供了文件大小。本章是在文件系统上,因此这些数据点的目的是与您在典型的存储设备上看到的相似。

文件长度(字节)文件的百分比小于长度
16.67
27.67
48.33
811.30
1611.46
3212.33
6426.10
12828.49
......
1KB47.82
......
1 Mb98.99
...... ...
128 MB100

在表中,您会看到该服务器上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
16.67
27.67
48.33
811.30
1611.46
3212.33
6426.10
12828.49
......
1KB47.82
......
1 MB98.99
......
128 MB100

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

画离情绘悲伤 2025-02-09 17:04:18

我不熟悉那张桌子,但这引起了我的兴趣。我不确定当时的1个字节文件是什么,但是今天的1字节文件也许可以散发出一些灯光吗?

我搜索了Size 1 Byte的文件,并

sudo find / -size 1c 2>/dev/null | while read line; do ls -lah $line; done

查看系统上这些文件的内容,它们包含一个字符: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

sudo find / -size 1c 2>/dev/null | while read line; do ls -lah $line; done

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文