perl-5.38.0
truncate FILEHANDLE,LENGTH
truncate EXPR,LENGTH

Truncates the file opened on FILEHANDLE, or named by EXPR, to the specified length. Raises an exception if truncate isn't implemented on your system. Returns true if successful, undef on error.

FILEHANDLE 上にオープンされたファイルか、EXPR で名前を表わしたファイルを、 指定した長さに切り詰めます。 システム上に truncate が実装されていなければ、例外が発生します。 成功すれば真を、エラー時には undef を返します。

The behavior is undefined if LENGTH is greater than the length of the file.

LENGTH がファイルの長さより大きい場合の振る舞いは未定義です。

The position in the file of FILEHANDLE is left unchanged. You may want to call seek before writing to the file.

FILEHANDLE のファイルの位置は変わりません。 ファイルに書き込む前に seek を 呼び出したいかもしれません。

Portability issues: "truncate" in perlport.

移植性の問題: "truncate" in perlport