ftruncate

(PHP 4, PHP 5, PHP 7, PHP 8)

ftruncateTronca un file alla lunghezza data

Descrizione

ftruncate(resource $handle, int $size): bool

Prende il puntatore al file handle e tronca il file alla lunghezza indicata da size. Restituisce true in caso di successo, false in caso di fallimento.

Nota:

Nelle versioni di PHP precedenti alla 4.3.3, la funzione ftruncate() restituisce un integer di valore 1 se l'operazione riesce, anziché restituire boolean true.

See also fopen() and fseek().