SolFS中这些函数的等价物

Equivalents for these functions in SolFS?

本文关键字:等价物 函数 SolFS      更新时间:2023-10-16

我正在为一个应用程序进行扩展。我的扩展使用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)等同物?

我认为最好在论坛或帮助台的Eldos网站上询问您的问题。

为了实现ungetc,你必须分配一个小缓冲区,把字符放在ungetc函数中,并检查fgetc函数的缓冲区。

lseek函数,您可以通过SolFSStream.Seek方法实现,所以我认为您不需要执行fileno函数。