1161 views|6 replies

237

Posts

0

Resources
The OP
 

What is the end of a .bin file? How to change the file size? [Copy link]

The microcontroller mounts the file system. The following two instructions can get the number of file bytes to be 1024. What should I do if I want to change it to 1000?

fseek(f,0,SEEK_END); //Move the pointer to the end

size = (uint16_t)ftell(f); //Get pointer offset

I have a device that sends bin file contents when connected to the Internet. I want to subtract the size of each part I send to prevent a sudden network disconnection and repeated sending next time I connect to the Internet.

Thank you, everyone, please help

This post is from MCU

Latest reply

This bin file is also newly created by me in the program~ It is used to store sensor data when the network is disconnected, because there are a lot of 0x00 and FF, which is not suitable for TXT storage[/quote] Oh, then the magic tool ultraedit is very useful ~ the functions are extremely powerful  Details Published on 2023-2-23 11:19
 

6744

Posts

2

Resources
2
 

Create a new bin file and copy 1000 bytes of the original bin file's contents to it.

This post is from MCU
 
 

2926

Posts

0

Resources
3
 

Use hexadecimal editing software such as HexEditor.

This post is from MCU
 
 
 

4764

Posts

12

Resources
4
 

bin is compiled and it is not recommended to modify it directly~

This post is from MCU

Comments

This bin file is also created by me in the program. It is used to store sensor data when the network is disconnected, because there are a lot of 0x00 and FF, which are not suitable for TXT storage.  Details Published on 2023-2-23 08:40
 
 
 

237

Posts

0

Resources
5
 
Azuma Simeng published on 2023-2-23 07:56 bin is compiled and it is not recommended to modify it directly~

This bin file is also created by me in the program. It is used to store sensor data when the network is disconnected, because there are a lot of 0x00 and FF, which are not suitable for TXT storage.

This post is from MCU

Comments

Oh, then the magic tool ultraedit is very useful ~ the functions are extremely powerful  Details Published on 2023-2-23 11:19
 
 
 

7422

Posts

2

Resources
6
 

Binary editors can have a look.

This post is from MCU
 
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

4764

Posts

12

Resources
7
 
Azuma Simeng published on 2023-2-23 07:56 bin is compiled and it is not recommended to modify it directly~
This bin file is also newly created by me in the program~ It is used to store sensor data when the network is disconnected, because there are a lot of 0x00 and FF, which is not suitable for TXT storage

Oh, then the magic tool ultraedit is very useful ~ the functions are extremely powerful

This post is from MCU
 
 
 

Guess Your Favourite
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list