- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- How to decide when to use RMS or POSIX stream oper...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2012 02:42 PM
11-12-2012 02:42 PM
How to decide when to use RMS or POSIX stream operation to read file content?
Hi
I am having issue reading files from C-program using RMS call sys$get when RAB buffer size is 32767 bytes and file information report that max record size is 32767 bytes.
For example this file:
$ dir /fu SYS$SYSDEVICE:[SYS0.SYSCOMMON.SYSFONT.DECW.100DPI]TERMINAL_BOLD36_100DPI.PCF
Directory SYS$SYSDEVICE:[SYS0.SYSCOMMON.SYSFONT.DECW.100DPI]
TERMINAL_BOLD36_100DPI.PCF;1 File ID: (594,1,0)
Size: 91/96 Owner: [SYSTEM]
Created: 30-AUG-2007 11:35:01.48
Revised: 30-AUG-2007 11:35:01.49 (1)
....
Linkcount: 1
File organization: Sequential
Shelved state: Online
Caching attribute: Writethrough
File attributes: Allocation: 96, Extend: 0, Global buffer count: 0
No version limit
Record format: Stream_LF, maximum 0 bytes, longest 32767 bytes
Record attributes: Carriage return carriage control
RMS attributes: None
Journaling enabled: None
File protection: System:RWED, Owner:RWED, Group:RE, World:RE
Access Cntrl List: None
Client attributes: None
Total of 1 file, 91/96 blocks.
When I am reading this file, i am getting error RMS$_RTB and rab$l_stv shows 41070 bytes.
I guess, this and other files with a similar error are just a binary files.
I could try to read them using fopen/fread but I need to know this up-front and before I start reading data; not after sys$get call failed.
Is there is a way to tell if file is really a binary file?
Thanks
- Tags:
- RMS OpenVMS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2012 08:24 AM - edited 11-13-2012 08:25 AM
11-13-2012 08:24 AM - edited 11-13-2012 08:25 AM
Re: How to decide when to use RMS or POSIX stream operation to read file content?
Take a look at the arguments for F$FILE_ATTRIBUTES. RAT, RFM, and ORG come to mind as options that might help narrow down a file type.
If by binary file you mean an executable image, the file extension (.exe) is a clue, although not a guaranty. Some of the ANALYZE file options might also be useful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2012 08:56 AM
11-13-2012 08:56 AM
Re: How to decide when to use RMS or POSIX stream operation to read file content?
I did check all the attributes, but I don't think it will help in all case.
It would be nice if all the files are created with appropriate attributes.
The disturbing thing is, the OS installed files has inconsistent attributes too (SYS$SYSDEVICE:[SYS0.SYSCOMMON.SYSFONT.DECW.100DPI]TERMINAL_BOLD36_100DPI.PCF).
I am wondering if combination of attribute's values can help.
For example, for above file, the LRL (Longest record length) shows 32767, and MRS (Maximum record size) is 0.
While reading, one of the records is 41070 bytes long (much longer than 32767).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2012 09:05 AM
11-13-2012 09:05 AM
Re: How to decide when to use RMS or POSIX stream operation to read file content?
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2012 09:34 AM
11-13-2012 09:34 AM
Re: How to decide when to use RMS or POSIX stream operation to read file content?
The file must be created with fixed records attribute in a first place and it is outside by control.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2012 11:05 AM
11-13-2012 11:05 AM
Re: How to decide when to use RMS or POSIX stream operation to read file content?
RMS record I/O using SYS$GET can only handle a maximum record size of 32767 bytes...as you found out.
Either use Unix I/O functions i.e. open without parameter "rfm=..." or, open the file with RMS specifying UFO in the FAB and access the file with SYS$QIO[W].
Btw, the "Carriage return carriage control" means if RMS ouputs records to a printing device (i.e. terminal) each record should have a CR/LF added. The "Carriage return" is NOT stored in the file.
/Guenther
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2012 11:16 AM - edited 11-13-2012 11:17 AM
11-13-2012 11:16 AM - edited 11-13-2012 11:17 AM
Re: How to decide when to use RMS or POSIX stream operation to read file content?
>>>The file in question was created by OS installation and based on file information it should use LF as a field separator.