Question

I am making an extension for an application. My extension uses SolFS and I want to use it to redirect all file traffic to SolFS. To accomplish this I need a bit of help because SolFS has not the equivalents for all needed functions (3 to be exactly)

This is the code which I will be 'converting': http://pastebin.com/REh5MqSa

Here is a list of stuff SolFS has:

//stuff I need which SolFS has
x    remove
x    fopen
x    fclose
x    fwrite
x    fread
x    access
x    fgetpos
x    fsetpos

This ones I can easily create on my own:

//stuff I can easily make
fgetc//I can easily make this one, Read with length onecand add one position to the seek, right?
fputc//Also easily done, write with seek, 1 char

And with this ones I would need your help:

//stuff solFS doesn't have and I need help with
ungetc//how would i create an equivalent in for use with SolFS?
lseek//how would I create an lseek?
fileno//how? for use with lseek

How would I accomplish creating ungetc, lseek and fileno (fileno is for use with lseek) equivalents with the provided functions by SolFS?

Was it helpful?

Solution

I think it is better to ask your question on Eldos website in the forum or HelpDesk.

In order to implement ungetc you have to allocate a small buffer put the character there in ungetc function and examine the buffer in fgetc function.

lseek function you can implement via SolFSStream.Seek method, so I don't think you need to impement fileno function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top