File Type Table

From Liberty BASIC Family
Jump to navigation Jump to search

Below find a table of the relation between file content type and preferred access mode.

File Access Modes Best Practice
Content Mime Type Typical Extension Access Mode Reading Writing Open Mode
Plain Text text/plain ini, txt, log Sequential INPUT PRINT read or write
Random Access Random GET PUT read and write (*)
Anything else bmp, gif, doc, etc. Binary INPUT$() PRINT read and write (*)

(*) The file must be WRITE-able. So attempting to open a read-only file (or file from read-only media, like CD) for RANDOM or BINARY will fail.