15 Memory files
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • SWI-Prolog C-library
        • Memory files
          • new_memory_file/1
          • free_memory_file/1
          • open_memory_file/3
          • open_memory_file/4
          • size_memory_file/2
          • size_memory_file/3
          • atom_to_memory_file/2
          • insert_memory_file/3
          • delete_memory_file/3
          • memory_file_to_atom/2
          • memory_file_to_atom/3
          • memory_file_to_codes/2
          • memory_file_to_codes/3
          • memory_file_to_string/2
          • memory_file_to_string/3
          • memory_file_substring/5
          • memory_file_line_position/4
Availability::- use_module(library(memfile)).(can be autoloaded)
memory_file_to_atom(+Handle, -Atom, +Encoding)
Return the content of the memory-file in Atom, pretending the data is in the given Encoding. This can be used to convert from one encoding into another, typically from/to bytes. For example, if we must convert a set of bytes that contain text in UTF-8, open the memory file as octet stream, fill it, and get the result using Encoding is utf8. Currently only supported if Encoding is one of iso_latin_1, octed (the same as iso_latin_1), wchar or utf8. Use with another encoding raises a domain error.