[Scummvm-devel] File API
Marcus Comstedt
marcus at mc.pp.se
Fri Feb 6 08:03:13 CET 2004
Max Horn <max at quendi.de> writes:
> To make that work, though, File would have to do voodoo and access the
> FileManager, and all... so, maybe we'd end up with syntax like:
> File *file = g_fileManager.open("path");
>
> What I don't like about this that we loose the nice "auto-cleanup"
> property of class File: that is, if you create a File instance on the
> stack, it'll automatically be disposed (and thus, the file be closed)
> when the scope is left.
This is a mixed blessing though. If you don't explicitly close the
file, you'll not notice any error caused by the close operation (due
to failure to flush buffers to disk or whatever). It should be ok for
read-only files, but certainly not for read-write or write-only ones.
// Marcus
More information about the Scummvm-devel
mailing list