Popen problem

Hello all,

I am reading a huge zip file in POPEN process and then writting that to a normal file which of 2GB. Now the process is failing when I looked for the cause someother process comming in after I read my file and it is deleting the zip. But in theory the popen command should read the zip file in memory and even a process deletes that it should have not failed right. Do you know what is the causing the process to fail

Thanks
Arun

First off, is this when it's running in Windows or not? Windows does not handle deletion the same way.

Second, in what way does it actually fail? What happens?

Third, your last printf seems a little wonky:

::sprintf(szBuf,"(%d) Total  %.0f",m_nPid,);

Two conversion modifiers %d %f, and only one argument.

Thanks for the reply . my Answers below

  1. it is failing only in LINUX

  2. the process is not failing, it just give this error . (Note this error is not comming from code)
    error: zipfile read error
    (23409) Total records read 23897400

  3. Sorry my type please read the last code as

::sprintf(szBuf,"(%d) Total records read      %.0f",m_nPid,m_Counter);

Here is what I found. The zip file I am trying to remove is on NAS. Actually when we remove the file from same host then the error is not happening I mean run the unzip on one host and remove the zip file same host then the error is not happening. If I run the process in one host and remove the file from other host which has the same NAS mount then the error is happening .

THanks,
Arun

Which version of NFS are you using on the clients? NFSv3 or NFSv4? It can be different on different clients.

NFSv3 is completely stateless - it has no concept of an open file. If the client that is seeing the error is using NFSv3 to mount the file system, any other host is free to delete the file.

NFSv4 is supposed to maintain file open and close state, but since it's much more maintenance-intensive I've always just used NFSv3 - my NFSv4 experiences haven't been good.

Thanks .. How to check whether I am using NFSV3 or NFSv4

found using mount -v :slight_smile: thanks anyway