Differences between internal and external files

From Br Wiki
Jump to: navigation, search

Internal files have a header record, which means that the first 100 or so bytes of the file describe the record length, the related keys, and other important stuff that BR needs in order to read and write from the file.

External files are just opened raw and directly, on the disk. Therefore you can open an internal file and check the record length, whereas when you open an external file you always have to SPECIFY the record length.

External files mean "open this file as is", so you could in theory use it to modify jpg files, or pdf files or any kind of file at all, provided you knew enough about how the file worked.

Internal files are BR files, and the information in the header makes it easier to read and write your data to them.

For an internal file, all you need is a write statement and a form statement. But in an external file, you have to read and write byte by byte in the file (or you can read a chunk of bytes at a time, and you can still use simpler form statements to help,) but you loose the header information, because its assumed you're interacting with some other person's data files from some other language, so you can't assume what the header record contains or if there even is one.