27.06.2015, 01:50
Hey there.
it's me or this code from wiki doesn't works?
for me always return 0
https://sampwiki.blast.hk/wiki/Fseek
it's me or this code from wiki doesn't works?
for me always return 0
https://sampwiki.blast.hk/wiki/Fseek
Код:
// Open "file.txt" in "read only" mode
new File:handle = fopen("file.txt", io_read);
// If "file.txt" is open
if(handle)
{
// Success
// Jump to the 1st byte of "file.txt", and print its position
printf("Begin of file position: %d", fseek(handle, 0, seek_begin));
// Jump to the last byte of "file.txt", and print its position
printf("End of file position: %d", fseek(handle, 0, seek_end));
// Jump to the same byte of "file.txt", and print its position
printf("Currrent file position: %d", fseek(handle, 0, seek_current));
// Close "file.txt"
fclose(handle);
}
else
{
// Error
print("Failed to open \"file.txt\".");
}

