Truncate a file in c++

7 views
Skip to first unread message

Gui D

unread,
Apr 24, 2019, 9:46:29 AM4/24/19
to
Hi,

I ve got a file "fichier" that i try to truncate.

when i use this


truncate ("C:/Users/H2O/Desktop/odoo_exe/fichier.txt",1024);

it truncates the file but not all the file just a part in the middle of the file where lettre are repaced by a blank and let the tail of the file as it was.
What could i do, is there sommeone who knows the proleme

2. question in
int ftruncate(int fd, off_t length);

what does represent int fd ? Where could i found a good help on c++ ?


Thank you
Reply all
Reply to author
Forward
0 new messages