Writing Files asynchronously
- From: grice@xxxxxxxxxxxx
- Date: 22 Aug 2005 10:06:17 -0700
I have a classic app that uses FSWrite to store text into a file.
Ocassionally the app hangs when FSWrite is referencing a file on a
remote volume (Sun Unix disk with an AppleTalk stack installed). The
app will hang indefinitely (or until the user restarts the machine).
The problem is probably someplace in the Unix driver code and the
company that produced that code is gone.
I would like to work around the hang condition so I thought I'd convert
the FSWrite call to a PBWriteAsync call so I could monitor the
operation and kill off the write operation if it exceeded some
reasonable threshold. I coded the call up.
I got the PBWriteAsync call to work to a point. If the call completes
successfully, all is good. But when the call fails to complete, the
code then proceeds to close the file without change and then the app
abruptly crashes.
I suspect that the PBWrite request is actually completing after the
file is closed and writing over something that should remain untouched
by errant applications.
So I went looking for a way to kill off the pending I/O request.
KillIO seemed like an obvious choice at first but I soon discovered it
was intended to be used at the device driver level rather then the file
I/O level.
So I'm hunting for a function equivalent to KillIO that I can use with
an async file write operation.
Is there such a thing or is there a better way to work around my
original problem?
Your thoughts please.
Gary
.
- Follow-Ups:
- Re: Writing Files asynchronously
- From: David Phillip Oster
- Re: Writing Files asynchronously
- From: Kurt Bigler
- Re: Writing Files asynchronously
- From: Inverter
- Re: Writing Files asynchronously
- Prev by Date: Re: unable to compile MSL-free C++ Carbon Mach-O target
- Next by Date: Re: Writing Files asynchronously
- Previous by thread: unable to compile MSL-free C++ Carbon Mach-O target
- Next by thread: Re: Writing Files asynchronously
- Index(es):
Relevant Pages
|