File Retrieving

Author(s): Christian Giménez.

This module is responsible for loading the HTML or Pillow file and giving enough predicates to find and open, getting information and closing the file.

The most interesting predicate for you programmer, may be open_file/2.

Comments on the Implemetation Issues

A String Problem

There is a string problem, the atom2term module have problems when you want to transform a string with '/' at the beggining and in the middle. Predicates like string2term/2 give a bad results and I don't know why.

So we split the URL into a list of folders using the '/' as separator, and then we transform them into terms. After that, we concat the atoms.

With the result of all this process, we have an URL as a term.

In other words:

  1. Split the string into a list of folder(and archive) names
  2. Transform each string(folder names) of the list into an term
  3. Concatenate each term into a complete URL again
  4. that's it!

Using the File

Functions for opening and manipulating the file.

Usage and interface

Documentation on exports


Usage: open_file(+File,-Str,-Exists)

  • Description: Open the file given by the path in the string File. If the file is in the home dir, and it can be opened, return the contents in Str.

    If the local path doesn't exists, the Exists will return the false/0, else will return true/0.


Usage: is_pillow_file_a(+File)

  • Description: t iff File has a Pillow extension(.pl).