Ga naar hoofdinhoud

fopen

waarschuwing

This function starts with a lowercase letter.

Beschrijving

Open een bestand om te lezen of te schrijven.

NaamBeschrijving
const filename[]Pad naar het bestand (zonder pad opent in 'scriptfiles').
filemode:modeModus om te openen (standaard: io_readwrite).

Retourneert

Een file‑handle (te gebruiken met lees/schrijf functies), of 0 bij falen.

Voorbeelden

new File:handle = fopen("file.txt", io_read);
new buf[128];
if (handle)
{
while (fread(handle, buf))
{
print(buf);
}
fclose(handle);
}