pro open_da_file, lun, dir, prefix, fileID, rsiz, bytout, fpoint, qs_struct, init_qs=init_qs, qsbuff=qsbuff, nolower=nolower ; ; ;HISTORY: ; Written Fall 1991 by M.Morrison ; 3-Mar-92 (MDM) - changed to use "concat_dir" to make the ; output file name ; 24-Nov-92 (MDM) - Modified to change the file protection to ; "rw-rw-rw" when running on Unix system. ; 4-Nov-08 (LWA) - Commented out MDM's 24-Nov-92 change to prevent ; ".login: No such file" error message. ; ref_struct, ref gen_struct, pointer=fpoint ; lun = abs(lun) close, lun ;openw, lun, dir + prefix + fileID, rsiz ;TODO - determine proper open switches ;;infil = filnam_fix(dir + prefix + fileID) infil = concat_dir(dir, prefix + fileID) if (not keyword_set(nolower)) then infil = strlowcase(infil) openw, lun, infil, /block ;if (!version.os ne 'vms') then spawn, 'chmod 666 ' + infil ;added 24-Nov-92 ; bytout = 0 rdwrt, 'W', lun, bytout, rsiz, {pointer_rec}, 1 ; fpoint.file_header = bytout rdwrt, 'W', lun, bytout, rsiz, {file_header_rec}, 1 ; ;----- Get the qs information and write it out (assumes only one entry for each QS structure - it will be over ; written at the end of the reformatter - if items have changed, the structure will be re-defined and expanded) ; fpoint.qs_section = -1 ; if (keyword_set(init_qs)) then init_qs, strmid(prefix,0,1), qs_struct if (get_nbytes(qs_struct) gt 1) then begin ;found a QS struct fpoint.qs_section = bytout ;;print, '#Bytes of QS_STRUCT = ', get_nbytes(qs_struct), ' for ', prefix rdwrt, 'W', lun, bytout, rsiz, qs_struct, 1 if (keyword_set(qsbuff)) then rdwrt, 'W', lun, bytout, rsiz, bytarr(4096), 1 ;write a buffer area for QS expansion end ; fpoint.data_section = bytout fpoint.opt_section = -1 ; end