Next: , Previous: , Up: Data I/O Routines   [Contents][Index]


4.2.2 Disk File Input/Output

Both output to and input from disk files is provided through associated variables (created through subroutine assoc) and file arrays (created through subroutine fltfarr and cousins), which behave to some extent like ordinary data arrays.

Output to disk files is also provided through classical file operations, such as opening disk files for writing (subroutines openw and openu), writing to disk files (subroutines printf and fprintf for formatted output, writeu for unformatted output).

Input from disk files is likewise provided through opening disk files for reading (subroutine openr), reading from disk files (subroutines readf and freadf for formatted input, readu for unformatted input).

Also useful in these cases is repositioning the file pointer (subroutine fileptr), closing disk files (subroutine close), and getting the disk file size (function filesize).

In addition, LUX supports input and output of files according to various standard formats, such as uncompressed GIF files (gifread, gifwrite), lossy compressed JPEG files (jpegread, jpegwrite), FITS files with or without extensions (fits_read, fits_write), and LUX’s own FZ format, which comes in uncompressed (fzread, fzwrite) and compressed flavors (fcwrite). Unformatted files can be transformed into FZ files, using filetofz.

See also: assoc, Associated Variables, close, fileptr, filesize, filetofz, fits_read, fltfarr, fprintf, freadf, File Arrays, openr, openu, openw, printf, readf, readu, writeu, gifread, gifwrite, jpegread, jpegwrite, fzread, fzwrite, fcwrite