home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 18759 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  2.4 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!news.service.uci.edu!beckman.com!rlmeyering
  2. From: rlmeyering@beckman.com
  3. Newsgroups: comp.lang.c
  4. Subject: VMS c, how to read stream files
  5. Message-ID: <1992Dec21.182025.1075@beckman.com>
  6. Date: 21 Dec 92 18:20:25 PDT
  7. Organization: Beckman Instruments, Inc.
  8. Lines: 87
  9.  
  10. ##### PLEASE RESPOND VIA E-MAIL ######
  11.  
  12. Hi,
  13.  
  14. I am using this code to open a file for input....
  15.  
  16.     if ( ( in = fopen( argv[1], "r" ) ) == NULL) {
  17.         printf( "\n%Error: unable to open input file %s", argv[1] );
  18.         exit( 0 );
  19.     }
  20.  
  21.  
  22. This is the dir/full listing of the file i'm opening:
  23.  
  24. TEST.DAT;2                    File ID:  (8558,40,0)       
  25. Size:            1/3          Owner:    [TSS,RLMEYERING]
  26. Created:  21-DEC-1992 17:47:36.44
  27. Revised:  21-DEC-1992 17:47:36.65 (1)
  28. Expires:  21-MAR-1993 17:48:06.90
  29. Backup:    <No backup recorded>
  30. File organization:  Sequential
  31. File attributes:    Allocation: 3, Extend: 0, Global buffer count: 0, Version limit: 2
  32. Record format:      Stream
  33.  
  34.               ^^^^^^^^^^^^ (note: , maximum 56 bytes not shown)
  35.                     ( see other listing below)
  36.  
  37. Record attributes:  Carriage return carriage control
  38. RMS attributes:     None
  39. Journaling enabled: None
  40. File protection:    System:RWED, Owner:RWED, Group:RE, World:RE
  41. Access Cntrl List:  None
  42.  
  43. Total of 1 file, 1/3 blocks.
  44.  
  45.  
  46. When I do the following:
  47.  
  48.     ch=fgetc(in);
  49.     
  50.     ch is returned == EOF.
  51.  
  52. A $dump/hex/byte of the file shows bytes:
  53.  
  54.     1 = 0x88
  55.     2 = '?'
  56.     3 = 'H'
  57.     4 = 0x88
  58.  
  59. If I do an anal/rms/fdl test.dat
  60. then change the organization (with edit/fdl) to SEQUENTIAL
  61.  
  62. followed by: 
  63.  
  64. convert/fdl test.dat test.dat;0
  65.  
  66. I get the file shown below:
  67.  
  68. TEST.DAT;3                    File ID:  (8990,282,0)       
  69. Size:            1/3          Owner:    [TSS,RLMEYERING]
  70. Created:  21-DEC-1992 17:50:36.44
  71. Revised:  21-DEC-1992 17:50:36.65 (1)
  72. Expires:  21-MAR-1993 17:50:06.90
  73. Backup:    <No backup recorded>
  74. File organization:  Sequential
  75. File attributes:    Allocation: 3, Extend: 0, Global buffer count: 0, Version limit: 2
  76. Record format:      Stream, maximum 56 bytes
  77.  
  78.               ^^^^^^^^^^^^^^^^^^ this appears to be the only
  79.                          difference.
  80.  
  81. Record attributes:  Carriage return carriage control
  82. RMS attributes:     None
  83. Journaling enabled: None
  84. File protection:    System:RWED, Owner:RWED, Group:RE, World:RE
  85. Access Cntrl List:  None
  86.  
  87. Total of 1 file, 1/3 blocks.
  88.  
  89.  
  90. After the convert/fdl... my program can read the file.
  91.  
  92. Does anyone know what is going on?
  93.  
  94.                     RLMeyering
  95.  
  96.  
  97.