gpt4 book ai didi

linux - 如何使用 Bash 将整数写入二进制文件?

转载 作者:IT王子 更新时间:2023-10-29 00:26:07 29 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
using bash: write bit representation of integer to file

我需要将文件的大小写入二进制文件。例如:

$ stat -c %s in.txt 
68187

$ stat -c %s in.txt >> out.bin

我不想将 68187 作为字符串写入 out.bin,而是将其作为 4 字节整数写入 out.bin。

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com