# # STDIO/FSEEK.D - Miscellanious support for stdio # public method int File.fseek(off_t offset, int whence) { this.fflush(); this.in.base = 0; this.in.index = 0; this.flags &= ~F_EOF; if (this.flags & F_ISREG) { this.pos = this.fs.lseek(offset, whence); $ = 0; } else { this.fs.error = Sys.EINVAL; $ = -1; } } public method off_t File.ftell() { if (this.flags & F_ISREG) { $ = this.pos; } else { this.fs.error = Sys.EINVAL; $ = -1; } } public method void File.rewind() { this.fflush(); if (this.flags & F_ISREG) this.fseek(0, Fs.SEEK_SET); this.clearerr(); this.in.base = 0; this.in.index = 0; }