Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
io.lib
03-27-2017, 11:59 AM
Post: #1
io.lib
io.lib provides a few I/O related functions.

Location: cod://utilities/io

It depends on zlib.

Filer
Filer provides FS functions.
Find all posts by this user
Quote this message in a reply
03-13-2018, 06:00 PM
Post: #2
RE: io.lib
Qiracle - pls add a test to test how Filer::Read() works if it is instantiated with a dir. I felt there may be a situation that it has not taken care of, yet.
Find all posts by this user
Quote this message in a reply
03-13-2018, 06:39 PM
Post: #3
RE: io.lib
(03-13-2018 06:00 PM)lingu Wrote:  Qiracle - pls add a test to test how Filer::Read() works if it is instantiated with a dir. I felt there may be a situation that it has not taken care of, yet.

Seems not in the cc list, cc'ed now.
Find all posts by this user
Quote this message in a reply
03-13-2018, 07:02 PM
Post: #4
RE: io.lib
(03-13-2018 06:00 PM)lingu Wrote:  Qiracle - pls add a test to test how Filer::Read() works if it is instantiated with a dir. I felt there may be a situation that it has not taken care of, yet.

Got it.
Find all posts by this user
Quote this message in a reply
03-16-2018, 02:29 PM (This post was last modified: 03-16-2018 03:00 PM by qiracle.)
Post: #5
RE: io.lib
(03-13-2018 06:00 PM)lingu Wrote:  Qiracle - pls add a test to test how Filer::Read() works if it is instantiated with a dir. I felt there may be a situation that it has not taken care of, yet.

After my test, if it's instantiated with a dir, pfiMain_ will be Null in follow code:

Code:
void Filer::init(const _TCHAR *ptzPfn) {
......
   pfiMain_ = fopen(ptzPfn, "r+b");  
......
}

Then when running Filer::Read(char *pDest):
Code:
int Filer::Read(char *pDest){
......
   if (!pfiMain_) {
      state = FAILED;
      return r;
   }
.....

    llRead = fread(pDest, 1, Bize(), pfiMain_);

....
}

We can see that Read() will exit before run fread(). So currently Filer::Read() does not support instantiate with a dir. Should I improve Filer::Read() and make it support instantiate with a dir?
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: