fseek function
#1

Hey there.

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\".");
}
Reply
#2

Well...what is the content of the file?
Reply
#3

Binary File of 14 Kb size. but is the same problem with plain text.
Reply
#4

The wiki information was taken from the original documentation (http://www.compuphase.com/pawn/File_IO_Support.pdf) but it is apparent that several changes were made because several functions are completing missing and functions like fexist cannot search on partial file name as is described in the documentation. The fseek function may even be broken for all I know.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)