我正在为应用程序进行扩展。我的扩展使用SolFS,我想用它将所有文件流量重定向到 SolFS。为了实现这一点,我需要一些帮助,因为 SolFS 没有所有需要的功能的等价物(确切地说是 3 个)
这是我将“转换”的代码:http: //pastebin.com/REh5MqSa
这是 SolFS 拥有的东西的列表:
//stuff I need which SolFS has
x remove
x fopen
x fclose
x fwrite
x fread
x access
x fgetpos
x fsetpos
我可以自己轻松创建这些:
//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
有了这个,我需要你的帮助:
//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
我将如何使用 SolFS 提供的函数创建 ungetc、lseek 和 fileno(fileno 用于 lseek)等价物?