Re: Performance problem - Not able to write to file
- From: Geoff Clare <geoff@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 12 Mar 2010 13:40:50 +0000
Mark Hobley wrote:
#! /shell/nerd <vikasera@xxxxxxxxx> wrote:
I'm using KSH. Is there any way around this. It's really annoying. My
script works for say 10 machines but any greater connections it fails
while creating the file (using >> /tmp/out).
You need to secure a unique instance, before writing to the file:
That shouldn't be necessary with a POSIX-conforming shell.
The file should be opened with O_APPEND set, which will ensure
that no data is lost.
Some possible causes of the problem are:
1. The ksh that the OP is using doesn't set O_APPEND. Maybe clones
such as pdksh are like that; I doubt if any "real" ksh is.
2. The OP thinks the printf is being executed by ksh, but actually
it is being executed by a different shell.
3. The shell really is setting O_APPEND, and the underlying O/S has
a bug.
Before resorting to locking, the OP should at least try to find
out for sure whether O_APPEND is being set. On most systems he
should be able to do that using a tool such as truss or strace.
--
Geoff Clare <netnews@xxxxxxxxxxxxx>
.
- References:
- Performance problem - Not able to write to file
- From: #! /shell/nerd
- Re: Performance problem - Not able to write to file
- From: pk
- Re: Performance problem - Not able to write to file
- From: #! /shell/nerd
- Re: Performance problem - Not able to write to file
- From: #! /shell/nerd
- Re: Performance problem - Not able to write to file
- From: Geoff Clare
- Re: Performance problem - Not able to write to file
- From: #! /shell/nerd
- Re: Performance problem - Not able to write to file
- From: Mark Hobley
- Performance problem - Not able to write to file
- Prev by Date: Re: mount(8) followed by umount(8) fails
- Next by Date: Re: how to automatically run a script as long as an input file is available
- Previous by thread: Re: Performance problem - Not able to write to file
- Next by thread: python & perl bigint difference
- Index(es):
Relevant Pages
|