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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
2,168 次查看
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

标签 (1)
0 项奖励
回复
1 解答
1,856 次查看
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 项奖励
回复
4 回复数
1,856 次查看
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 项奖励
回复
1,856 次查看
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 项奖励
回复
1,857 次查看
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 项奖励
回复
1,856 次查看
maciejwdowiarz-
Contributor III

So I need to change the logic.

Thank you for checking that.

Regards,

Maciej

0 项奖励
回复