[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference star::wizards

Title: "ASK THE WIZARDS"
Moderator:QUARK::LIONEL
Created:Mon Oct 30 1995
Last Modified:Mon May 12 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1857
Total number of notes:3728

1817.0. "Open: how to use QIO in C" by STAR::JKEENAN () Tue Apr 29 1997 13:57

Return-Path: "VMS001::WWW"@vms001.das-x.dec.com
Received: by vmsmkt.zko.dec.com (UCX V4.1-12, OpenVMS V6.2 VAX);
	Thu, 24 Apr 1997 08:49:03 -0400
Received: from vms001 by mail11.digital.com (8.7.5/UNX 1.5/1.0/WV)
	id IAA25777; Thu, 24 Apr 1997 08:41:17 -0400 (EDT)
Date: Thu, 24 Apr 1997 07:45:04 -0400
Message-Id: <[email protected]>
From: "VMS001::WWW"@vms001.das-x.dec.com (24-Apr-1997 0745)
To: [email protected], [email protected], [email protected]
Subject: Ask the Wizard: '[email protected]'
X-VMS-To: [email protected]

Remote Host: rg5dynamic231.i-way.co.uk
Browser Type: Mozilla/3.01 (X11; I; SunOS 5.5.1 sun4u)
Remote Info: <null>
Name: David Dawkins
Email Address: [email protected]
CPU Architecture: VAX and Alpha
Version: v 6.2
Questions: 

Can you show me (in C) how to use QIO to:

- open a flat text file
- write to it
- read from it
- position the read/write pointer at a specific byte

Please?

T.RTitleUserPersonal
Name
DateLines
1817.1Please See Documentation; Consider RMSXDELTA::HOFFMANSteve, OpenVMS EngineeringTue Apr 29 1997 17:4319
   There are various examples of using the sys$qio and sys$qiow call in
   the OpenVMS documentation (specifically in the I/O User's Reference
   Manual, and in the Programming Concepts Manual), in the sys$examples:
   area, in the ucx$examples: area, on the freeware CD-ROM, and at various
   sites around the Internet.

   The sys$qio (XQP) I/O interface is a very low-level interface, and it
   bypasses all RMS record structures -- reads and writes are based on
   the virtual block (block within file) or logical block (block on disk).
   For obvious reasons, performing virtual operations is prefered by most
   programmers -- one can corrupt a disk with an errant logical-block I/O.

   Given your stated goals, I would use RMS -- it is much more flexible,
   and with a fixed-length sequential file, can perform this task quite
   easily.  Look through the above areas for sys$open, sys$close, etc.,
   and other RMS calls.  I would also consider using the C library calls
   for file I/O operations.  (And there are examples of both available.)