pro read_uf_rec,lun,rec_len,buffer ;================================================================== ; ; Written by S. D. Mayor in April 1996 to read blocked UF records. ; ; INPUT: LUN........... logical unit number to read from ; OUTPUT: REC_LEN...... number of bytes of data between markers ; BUFFER....... a byte array of length REC_LEN ; ; This subroutine reads a record from a file that has already been ; opened for reading under logical unit number LUN. This subroutine ; expects to see a 4-byte marker before and after the actual record. ; The 4-byte marker contains ; the number of bytes in between them. ; ;================================================================== marker = bytarr(4) readu,lun,marker rec_len=long(marker,0) ;print,'rec_len = ',rec_len buffer = bytarr(rec_len) readu,lun,buffer readu,lun,marker return end