sec : U Re: Accessing an ASCII database? [message #33414 is a reply to message #33321] |
Thu, 19 December 2002 15:14  |
Andrew Cool
Messages: 219 Registered: January 1996
|
Senior Member |
|
|
Jonathan Greenberg wrote:
>
> I'm trying to develop an IDL routine that allows multiple machines running
> IDL to query an ASCII database, and update it-- are there any prebuilt
> routines that could help me out with this? I'm running into problems using
> openu, because if two machines open the text file at the same time, strange
> things ensue. Anyone have experience with this or can point me to some
> scripts that could help me out?
>
> --j
Jonathon,
Have a look at the FSTAT function.
The fields OPEN, READ and WRITE should allow you to block access by a
second party until the file is released by the guy who's currently got
the
file open.
Andrew
Fields of the FSTAT Structure
The following descriptions are of fields in the structure returned by
the FSTAT function. They are not keywords to FSTAT.
UNIT � The IDL logical unit number (LUN).
NAME � The name of the file.
OPEN � Nonzero if the file unit is open. If OPEN is zero,
the remaining fields in FSTAT will not contain useful
information.
READ � Nonzero if the file is open for read access.
WRITE � Nonzero if the file is open for write access.
ISATTY � Nonzero if the file is actually a terminal instead of a normal
file. For example, if you are using an xterm window on a UNIX system and
you invoke FSTAT on logical unit 0 (standard input), ISATTY will be set
to 1.
ISAGUI � Nonzero if the file is actually a Graphical User Interface (for
example, a logical unit associated with the IDL Development
Environment). Thus, if you are using the IDLDE and you invoke FSTAT on
logical unit 0 (standard input), ISAGUI will be set to 1.
INTERACTIVE � Nonzero if either ISATTY or ISAGUI is nonzero.
XDR � Nonzero if the file was opened with the XDR keyword, and is
therefore considered to contain data in the XDR format.
COMPRESS � Nonzero if the file was opened with the COMPRESS keyword, and
is therefore considered to contain compressed data in the GZIP format.
------------------------------------------------------------ -----------------
Andrew D. Cool
Electromagnetics & Propagation Group
Intelligence, Surveillance & Reconnaissance Division
Defence Science & Technology Organisation
PO Box 1500, Edinburgh
South Australia 5111
Phone : 061 8 8259 5740 Fax : 061 8 8259 6673
Email : andrew.cool@dsto.defence.gov.au
------------------------------------------------------------ -----------------
|
|
|