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 ?

ソリューションへジャンプ
1,530件の閲覧回数
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,218件の閲覧回数
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,218件の閲覧回数
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,218件の閲覧回数
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,219件の閲覧回数
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,218件の閲覧回数
maciejwdowiarz-
Contributor III

So I need to change the logic.

Thank you for checking that.

Regards,

Maciej

0 件の賞賛
返信