Simple Virtual Filesystem in C/C++

前端 未结 6 1910
一个人的身影
一个人的身影 2020-12-31 15:02

I would like to implement a very simple Virtual Filesystem (VFS) which supports some basic file system operation like fwrite, fopen, fput, etc. The VFS is an abstraction lay

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-31 15:32

    I don't think you can compile a module for different OSes, the way you want.

    // Make the distinction at compile time,
    
    FILE VFS_File_Open( const unsigned char strFile, int flags )
    {
    #ifdef _WINDOWS
        //implement here the system calls required to open a file on a WIN OS
    #endif
    #ifdef _LINUX
        //implement here the system calls required to open a file on a Linux OS
    #endif
        etc
    }
    

提交回复
热议问题