SerweryWłasny serwerDla twórcówForumFAQDokumentacjaBezpieczeństwo
Pobierz launcher
  1. Dokumentacja
  2. Funkcje wspólne
  3. fileRead

Funkcja

fileRead

Serwer i klientPlikiIdentyczna z MTA:SA

Czyta podaną liczbę bajtów od bieżącej pozycji i przesuwa pozycję. Na końcu pliku zwraca pusty tekst. Dane binarne są zwracane bez zmian.

Składnia

string fileRead(file theFile, int count)

Argumenty

theFilefile
Uchwyt pliku.
countint
Liczba bajtów.

Zwraca

Odczytane dane albo false.

Przykład

local file = fileOpen("data.bin", true)
if file then
    while not fileIsEOF(file) do
        local chunk = fileRead(file, 500)
        outputDebugString(#chunk .. " bajtow")
    end
    fileClose(file)
end

Zobacz też