Well, I guess the difference in data block I/O semantics can be abstracted. For example `fread` is just `read` with an additional parameter. In particular

fread(buffer,1,N,stream) <=> read(fd,buffer,N)

It is harder if some file format requires `seek`, and underlying I/O system does not support such operations. The solution is to let `nullptr` denote that the I/O system does not support this operation. If the file format requires `seek` (TIFF and OpenEXR does, but PNG does not), and the user sets it to `nullptr`, there are two options: 1) Copy data to temporary storage, and process it further from there. 2) Fail. Or what happens if I `TIFFOpen("/dev/stdin","r")`.


_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to