我有一个大约 300MB 的文件。我在 Linux 上运行以下命令:
sudo debugfs -R“stat/home/user1/Documents/test.csv”/dev/sda2
我得到以下输出:
Inode: 16913580 Type: regular Mode: 0644 Flags: 0x80000
Generation: 3920968942 Version: 0x00000000:00000001
User: 1000 Group: 1000 Project: 0 Size: 301526706
File ACL: 0
Links: 1 Blockcount: 588928
Fragment: Address: 0 Number: 0 Size: 0
ctime: 0x5df9e6c2:7636fdcc -- Wed Dec 18 14:13:46 2019
atime: 0x5e67b696:d6bfb018 -- Tue Mar 10 21:17:34 2020
mtime: 0x5df11990:00000000 -- Wed Dec 11 22:00:08 2019
crtime: 0x5df9e6c0:63257940 -- Wed Dec 18 14:13:44 2019
Size of extra inode fields: 32
Inode checksum: 0x35f4d147
EXTENTS:
(ETB0):67695655, (0-8191):162652160-162660351, (8192-40959):165953536-165986303, (40960-57343):165986304-166002687, (57344-61439):166129664-166133759, (61440-65535):166135808-166139903, (65536-67583):166164480-166166527, (67584-71679):166168576-166172671, (71680-73614):166207623-166209557
我认为EXTENTS:
显示了文件的物理 block 。
我的问题是,是否可以直接从golang中的这些 block 号中读取字节数组?
最佳答案
My question is, is it possible to directly read from these block numbers in golang as byte array?
没有。
关于linux - golang直接从 block 读取,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60624037/