file busy status

How can I find if a file is busy in QNX 4. (In qnx2 the file attribute
has a “b” in it)
Cyndi

cynthia <d_cynthia@rediffmail.com> wrote:

How can I find if a file is busy in QNX 4. (In qnx2 the file attribute
has a “b” in it)

The file system implementation for QNX 4 is quite a bit different
from QNX 2, and there is no exact correspondent bit for the QNX 2
file busy one attribute.

What are you trying to do/what are you trying to use the busy attribute
for?

-David

QNX Training Services
dagibbs@qnx.com

My application continously writes to a disk file (testdata.log) for 2 mins.
If I power cycle the computer during this 2 mins, testdata.log is
corrupted. ie., If I type
$ more testdata.log
testdata.log: Corrupted file system found. → messages is displayed on the
console.

In QNX2 the file status remains busy after the power cycle. I like to know,
is this the same way it happens in QNX4 also. But the issue is the file
corruption during power cycle.


David Gibbs wrote:

cynthia <> d_cynthia@rediffmail.com> > wrote:
How can I find if a file is busy in QNX 4. (In qnx2 the file attribute
has a “b” in it)

The file system implementation for QNX 4 is quite a bit different
from QNX 2, and there is no exact correspondent bit for the QNX 2
file busy one attribute.

What are you trying to do/what are you trying to use the busy attribute
for?

-David

QNX Training Services
dagibbs@qnx.com

cynthia <d_cynthia@rediffmail.com> wrote:

My application continously writes to a disk file (testdata.log) for 2 mins.
If I power cycle the computer during this 2 mins, testdata.log is
corrupted. ie., If I type
$ more testdata.log
testdata.log: Corrupted file system found. → messages is displayed on the
console.

In QNX2 the file status remains busy after the power cycle. I like to know,
is this the same way it happens in QNX4 also. But the issue is the file
corruption during power cycle.

No, there will be no file status set to busy after a power cycle under
QNX4. You will probably want to run the chkfsys utility after any
power cycles to verify & correct the file system for corruption.

The message you see about a corrupt file system usually indicates that
more blocks have been allocated to the file than have been filled, it
is self-repairing, usually if you issue the “more testdata.log” command
again, you will not see it a second time. You will, though, likely
have lost some data.

You may be able to reduce the amout of data lost by opening the log
file with the O_DSYNC option – this requests that Fsys move the data
directly to disk, rather than cacheing it.

-David

QNX Training Services
dagibbs@qnx.com