1

I have some code on openVMS where getline doesn't split the lines the same way as VMS editors for example.

Is there some way to manipulate how getline return lines?

It worked well with files ftped over, put it doesnt work with some other files - i think it is RMS fixed length, with a lot of binary zeroes in them.

I am using ifstream.getline(buffer, maxsize), but it can be any getline.

user1987442
  • 128
  • 1
  • 2
  • 9

1 Answers1

0

This may be an issue with the RMS record attributes, notably a missing implied newline.

Check out $ help set file /attr Look for the various RAT options.

How did this file come to be?

If you would like further help, then please provide detail on the file with 'issues'. Attached, or include, output from $ DIRECTORY/FULL x.x

and if possible $ DUMP/RECORD=COUNT=3/WID=80 x.x

as well as $ DUMP/BLOCK=COUNT=1/WID=80 x.x

Hope this helps, Hein

Hein
  • 1,453
  • 8
  • 8
  • $ dir/full will show all the necessary information, but if you want/need to change them, it is more convenient to see the settable keywords and actual values as shown with the FATS tool (current version is 130218). Google should be able to find that for you. – user2116290 Jul 13 '13 at 14:27
  • Hi Hartmut, it helps to say 'vms2linux' when looking for your tool, as silly search engines try to 'help' by looking for 'fast'. Along the same lines I have a tool F$FILE which is similar to DCL F$FILE, but uses QIO access to be able to get attributes from locked files unlike the lexical. It also accepts a list of attributes. I just changed it to print the whole list if noting is requested, much like your too. Unfortunately there is no 'attach file' in stackoverflow is there? Hein. – Hein Jul 14 '13 at 05:36
  • They are fixed length without carriage return/newline (So the issue becomes if getline should "know" this) – user1987442 Jul 15 '13 at 15:17
  • So there are no 'newlines'. Then getline will simply return as many bytes as the program requests. Makes sense to me. Doc: "Functions the same as get(char *, int, char) except that these extract a terminating delim character from an istream object. If delim occurs when exactly len characters have been extracted, a filled array is considered to be the cause of the termination and the extraction leaves this delim in the istream object." Try SET FILE/ATTR=RAT=CR and run again. It will work. – Hein Jul 15 '13 at 21:34