File Types
The file service supports reading and writing different types of files. All files can be treated as binary files, but sometimes, it helps if we know that the file contains text or lines of text.
Binary files
Working with binary files is forward. File content is read from and written to streams in AL-code. Binary files do not care about the content. It can be text, images, or something else.
Text files
Text files can be more complex to handle than binary files. They can have different encodings, and in some encodings, different characters are represented by a different number of bytes. This makes it hard to translate a character index to a file position.
Line files
Line files are text files where the file service has split the file into lines. In some text files, a line break is represented by one byte, whereas it is two in other files. The file service handles this automatically.
When working with line files, you pass and receive a list of text lines in AL-code. You do not have to determine where one ends and the next starts.