FreeBASIC  0.91.0
dev_file_seek.c
Go to the documentation of this file.
1 /* file device */
2 
3 #include "fb.h"
4 
6 {
7  int res;
8  FILE *fp;
9 
10  FB_LOCK();
11 
12  fp = (FILE*) handle->opaque;
13 
14  if( fp == NULL ) {
15  FB_UNLOCK();
17  }
18 
19  res = fb_ErrorSetNum( fseeko( fp, offset, whence ) == 0 ? FB_RTERROR_OK : FB_RTERROR_FILEIO );
20 
21  FB_UNLOCK();
22 
23  return res;
24 }