phpday 2027 - Call for Papers

eio_write

(PECL eio >= 0.0.1dev)

eio_write — Write to file

Descrizione

function eio_write(
    mixed $fd,
    string $str,
    int $length = 0,
    int $offset = 0,
    int $pri = EIO_PRI_DEFAULT,
    callable $callback = NULL,
    mixed $data = NULL
): resource

eio_write() writes up to length bytes from str at offset offset from the beginning of the file.

Elenco dei parametri

fd

Stream, Socket resource, or numeric file descriptor, e.g. returned by eio_open()

str

Source string

length

Maximum number of bytes to write.

offset

Offset from the beginning of file.

pri

La priorità della richiesta: EIO_PRI_DEFAULT, EIO_PRI_MIN, EIO_PRI_MAX o null. Se viene passato null, pri viene impostato internamente a EIO_PRI_DEFAULT.

callback

La funzione callback viene chiamata quando la richiesta è completata. Deve corrispondere al seguente prototipo:

void callback(mixed $data, int $result[, resource $req]);
data

sono i dati personalizzati passati alla richiesta.

result

valore del risultato specifico della richiesta; in sostanza, il valore restituito dalla corrispondente chiamata di sistema.

req

è la risorsa opzionale della richiesta, che può essere usata con funzioni come eio_get_last_error().

data

Arbitrary variable passed to callback.

Valori restituiti

eio_write() returns request resource on success, o false in caso di fallimento.

Vedere anche:

+add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top