Logtalk reference manual
Conditional compilation directive: include/1
Contents > Reference Manual > Directives > include/1

## include/1

#### Description

    include(File)

Includes a file contents, which must be valid terms, at the place of occurrence of the directive. The file can be specified as a relative path, an absolute path, or using library notation and is expanded as a source file name. Relative paths are interpreted as relative to the path of the file contining the directive.

When using the reflection API, terms from an included file can be distinguished from terms from the main file by looking for the `include/1` predicate declaration or definition property. For the included terms, the `line_count/1` property stores the term line number in the included file.

This directive can be used as either a source file directive or an entity directive. As an entity directive, it can be used both in entities defined in source files and with the entity creation built-in predicates.

#### Template and modes

    include(@source_file_name)

#### Examples

    :- include(data('raw_1.txt')).

    :- include('factbase.pl').

    :- include('/home/me/databases/cities.pl').

    ?- create_object(cities, [], [public(city/4), include('/home/me/dbs/cities.pl')], []).