hereと here のドキュメントftruncate
を見てきました。IBMリンクの場合、それに応じて実装しましたが、エラーが発生します。コードは次のとおりです。ftruncate
Invalid Arguments
char const *path = "mozunit.txt";
int file_ = open(path, O_RDONLY, 0600);
int ftrunc_ = ftruncate(file_, 1);
cout<<strerror(errno)<<endl;
それはなぜです?2番目のパラメーターを変更しようとしましftruncate
たが、役に立ちませんでした。