home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!news.service.uci.edu!beckman.com!rlmeyering
- From: rlmeyering@beckman.com
- Newsgroups: comp.lang.c
- Subject: VMS c, how to read stream files
- Message-ID: <1992Dec21.182025.1075@beckman.com>
- Date: 21 Dec 92 18:20:25 PDT
- Organization: Beckman Instruments, Inc.
- Lines: 87
-
- ##### PLEASE RESPOND VIA E-MAIL ######
-
- Hi,
-
- I am using this code to open a file for input....
-
- if ( ( in = fopen( argv[1], "r" ) ) == NULL) {
- printf( "\n%Error: unable to open input file %s", argv[1] );
- exit( 0 );
- }
-
-
- This is the dir/full listing of the file i'm opening:
-
- TEST.DAT;2 File ID: (8558,40,0)
- Size: 1/3 Owner: [TSS,RLMEYERING]
- Created: 21-DEC-1992 17:47:36.44
- Revised: 21-DEC-1992 17:47:36.65 (1)
- Expires: 21-MAR-1993 17:48:06.90
- Backup: <No backup recorded>
- File organization: Sequential
- File attributes: Allocation: 3, Extend: 0, Global buffer count: 0, Version limit: 2
- Record format: Stream
-
- ^^^^^^^^^^^^ (note: , maximum 56 bytes not shown)
- ( see other listing below)
-
- 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
-
- Total of 1 file, 1/3 blocks.
-
-
- When I do the following:
-
- ch=fgetc(in);
-
- ch is returned == EOF.
-
- A $dump/hex/byte of the file shows bytes:
-
- 1 = 0x88
- 2 = '?'
- 3 = 'H'
- 4 = 0x88
-
- If I do an anal/rms/fdl test.dat
- then change the organization (with edit/fdl) to SEQUENTIAL
-
- followed by:
-
- convert/fdl test.dat test.dat;0
-
- I get the file shown below:
-
- TEST.DAT;3 File ID: (8990,282,0)
- Size: 1/3 Owner: [TSS,RLMEYERING]
- Created: 21-DEC-1992 17:50:36.44
- Revised: 21-DEC-1992 17:50:36.65 (1)
- Expires: 21-MAR-1993 17:50:06.90
- Backup: <No backup recorded>
- File organization: Sequential
- File attributes: Allocation: 3, Extend: 0, Global buffer count: 0, Version limit: 2
- Record format: Stream, maximum 56 bytes
-
- ^^^^^^^^^^^^^^^^^^ this appears to be the only
- difference.
-
- 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
-
- Total of 1 file, 1/3 blocks.
-
-
- After the convert/fdl... my program can read the file.
-
- Does anyone know what is going on?
-
- RLMeyering
-
-
-