Are there any equivalents for ftruncate() or chsize() functions from Linux/Windows in MQX ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Are there any equivalents for ftruncate() or chsize() functions from Linux/Windows in MQX ?

Jump to solution
1,108 Views
maciejwdowiarz-
Contributor III

I can't find any methods in MQX libaries designed for file trimming. How may I manage with this task ?

Thank you

Labels (1)
0 Kudos
1 Solution
796 Views
DavidS
NXP Employee
NXP Employee

Ok..thank you for additional information.

We do not have this function implemented in MQX.  I looked at tool libraries, MQX IO and MFS without success.

Googling did find source to review for truncate: PlibC: File Index

Regards,

David

View solution in original post

0 Kudos
4 Replies
796 Views
DavidS
NXP Employee
NXP Employee

Hi Maciej,

To my knowledge there are no such commands and capabilities.

What kind of file are you trying to trim?  Picture, audio, text, other?

Regards,

David

0 Kudos
796 Views
maciejwdowiarz-
Contributor III

I've mechanism which controlls the size of log files and in case of extending predefined file size, causes ftruncate()/chsize() to reduce its size. Thus this is text file.

Regards,

Maciej

0 Kudos
797 Views
DavidS
NXP Employee
NXP Employee

Ok..thank you for additional information.

We do not have this function implemented in MQX.  I looked at tool libraries, MQX IO and MFS without success.

Googling did find source to review for truncate: PlibC: File Index

Regards,

David

0 Kudos
796 Views
maciejwdowiarz-
Contributor III

So I need to change the logic.

Thank you for checking that.

Regards,

Maciej

0 Kudos