Projects
AGS Engine | Files | File.Seek |
---|---|---|
Radiant | I was surprised to find that AGS doesn't have a file seek operation (i.e. move the file pointer to a given offset from the file start). Could this please be added? This could be a simple wrapper for C++'s fseek() function. | |
Crimson Wizard | Some thoughts on this. Although this does not stand out much, but AGS works with files in two modes: raw and safe. "Safe" functions read and write extra tags into file that let AGS trace if data is unserialized properly. Common Seek is not usable for "safe" files, because file cursor may be easily positioned in the middle of data field. I propose to consider implementing a file work mode which would restrict file to one of the function sets (safe or unsafe). Or, maybe split File class into two parts... although I wonder if backwards-compatibility could be maintained then. In either case we could also add safe Seek that would only move between tagged fields in file. | |
Radiant | This is intended for plain binary files; I've never used the "safe" format myself, and indeed as you say seeking in that can't be expected to work. |