2005-04-23 00:57:45 +01:00
2001-06-06 20:40:57 +01:00
:- protocol(systemp).
:- info([
2005-12-24 18:00:21 +00:00
version is 1.10,
2004-07-09 00:48:59 +01:00
author is 'Portable Operating-System Interface (POSI) initiative',
2006-02-10 17:44:05 +00:00
date is 2006/1/21,
2005-12-24 18:00:21 +00:00
comment is 'Portable operating system access protocol.',
remarks is [
'File names overview:' - 'The main idea is that file names should be operating-system independent. As such, predicates are needed to convert between portable file names and operating-system specific file names. The solution chosen is to use URL syntax for portable file names.',
'Local and remote file names:' - 'A (portable) file name may point to either a local file or a remote file.',
'URL file names:' - 'These are file names which start with an access protocol (e.g. {http, https, ftp, gopher, file}://).',
'Absolute file names:' - 'These are file names that always point to a local file. They always start with a slash character (/).',
'Relative file names:' - 'These are file names that always point to a local file. A file name is a relative file name if it does not start with a slash character or a file access protocol (including the :// characters).',
'Canonical file names' - 'These are file names where any environment variables was been expanded and where the sequences for current (.) and parent (..) directories have been resolved.',
'Time stamps:' - 'Time stamps are used for representing current, system time and in file properties to represent creation, modification, and access times. Time stamps are system-dependent terms but that can be compared (e.g. when testing which of two given files is older).']]).
2001-06-06 20:40:57 +01:00
:- public(make_directory/1).
2004-07-09 00:48:59 +01:00
:- mode(make_directory(+atom), one).
2001-06-06 20:40:57 +01:00
:- info(make_directory/1, [
2005-12-24 18:00:21 +00:00
comment is 'Makes a new directory. Argument is first expanded to a canonical file name.',
2004-06-06 23:46:45 +01:00
argnames is ['Directory'],
exceptions is [
2004-07-09 00:48:59 +01:00
'Directory is not instantiated' - instantiation_error,
2004-06-06 23:46:45 +01:00
'Directory is neither a variable nor a valid file name' - type_error(file_name, 'Directory'),
2004-07-25 19:47:43 +01:00
'No permission for making a new directory' - permission_error(write, 'Directory')]]).
2001-06-06 20:40:57 +01:00
:- public(delete_directory/1).
2004-07-09 00:48:59 +01:00
:- mode(delete_directory(+atom), one).
2001-06-06 20:40:57 +01:00
:- info(delete_directory/1, [
2005-12-24 18:00:21 +00:00
comment is 'Deletes an empty directory.',
2004-06-06 23:46:45 +01:00
argnames is ['Directory'],
exceptions is [
2004-07-09 00:48:59 +01:00
'Directory is not instantiated' - instantiation_error,
2004-06-06 23:46:45 +01:00
'Directory is neither a variable nor a valid file name' - type_error(file_name, 'Directory'),
2005-12-24 18:00:21 +00:00
'Directory does not exists' - existence_error(directory, 'Directory'),
2004-07-09 00:48:59 +01:00
'No permission for deleting the directory' - permission_error(write, 'Directory'),
2005-12-24 18:00:21 +00:00
'Directory is not empty' - permission_error(write, 'Directory')]]).
2001-06-06 20:40:57 +01:00
:- public(change_directory/1).
2004-07-09 00:48:59 +01:00
:- mode(change_directory(+atom), one).
2001-06-06 20:40:57 +01:00
:- info(change_directory/1, [
2004-06-06 23:46:45 +01:00
comment is 'Changes current working directory.',
argnames is ['Directory'],
exceptions is [
2004-07-09 00:48:59 +01:00
'Directory is not instantiated' - instantiation_error,
2004-06-06 23:46:45 +01:00
'Directory is neither a variable nor a valid file name' - type_error(file_name, 'Directory'),
2004-07-09 00:48:59 +01:00
'No permission for accessing the directory' - permission_error(read, 'Directory'),
'Directory does not exists' - existence_error(directory, 'Directory')]]).
2001-06-06 20:40:57 +01:00
:- public(working_directory/1).
2004-11-29 20:36:31 +00:00
:- mode(working_directory(?atom), zero_or_one).
2001-06-06 20:40:57 +01:00
:- info(working_directory/1, [
2004-07-25 19:47:43 +01:00
comment is 'Current working directory (as an absolute file name).',
2004-06-06 23:46:45 +01:00
argnames is ['Directory'],
exceptions is [
'Directory is neither a variable nor a valid file name' - type_error(file_name, 'Directory')]]).
:- public(directory_exists/1).
:- mode(directory_exists(+atom), zero_or_one).
:- info(directory_exists/1, [
2004-07-25 19:47:43 +01:00
comment is 'True if the specified directory exists (irrespective of directory permissions).',
2004-06-06 23:46:45 +01:00
argnames is ['Directory'],
exceptions is [
2004-07-09 00:48:59 +01:00
'Directory is not instantiated' - instantiation_error,
2004-07-25 19:47:43 +01:00
'Directory is neither a variable nor a valid file name' - type_error(file_name, 'Directory')]]).
2001-06-06 20:40:57 +01:00
2005-12-24 18:00:21 +00:00
:- public(directory_files/3).
:- mode(directory_files(+atom, +atom, -list), one).
:- info(directory_files/3, [
comment is 'List of all directory files that matches a regular expression (returns an empty list when no file matches; may be used to find hidden files given an appropriate filter).',
argnames is ['Directory', 'Filter', 'Files'],
exceptions is [
'Directory is not instantiated' - instantiation_error,
'Directory is neither a variable nor a valid file name' - type_error(file_name, 'Directory'),
'No read permission for the directory' - permission_error(read, 'Directory'),
'Directory does not exists' - existence_error(directory, 'Directory'),
'Filter is not instantiated' - instantiation_error,
'Filter is neither a variable nor a valid regular expression' - type_error(regular_expression, 'Filter')]]).
2001-06-06 20:40:57 +01:00
:- public(directory_files/2).
2004-07-09 00:48:59 +01:00
:- mode(directory_files(+atom, -list), one).
2001-06-06 20:40:57 +01:00
:- info(directory_files/2, [
2005-12-24 18:00:21 +00:00
comment is 'List of all directory files (returns an empty list when the directory is empty; hidden files are not retrieved).',
2004-06-06 23:46:45 +01:00
argnames is ['Directory', 'Files'],
exceptions is [
'Directory is not instantiated' - instantiation_error,
'Directory is neither a variable nor a valid file name' - type_error(file_name, 'Directory'),
2004-07-09 00:48:59 +01:00
'No read permission for the directory' - permission_error(read, 'Directory'),
'Directory does not exists' - existence_error(directory, 'Directory')]]).
2002-05-28 12:29:37 +01:00
2001-06-06 20:40:57 +01:00
:- public(delete_file/1).
2004-07-09 00:48:59 +01:00
:- mode(delete_file(+atom), one).
2001-06-06 20:40:57 +01:00
:- info(delete_file/1, [
comment is 'Deletes a file.',
2004-06-06 23:46:45 +01:00
argnames is ['File'],
exceptions is [
'File is not instantiated' - instantiation_error,
'File is neither a variable nor a valid file name' - type_error(file_name, 'File'),
2004-07-09 00:48:59 +01:00
'File does not exists' - existence_error(file, 'File'),
'No write permission to the file' - permission_error(write, 'File')]]).
2001-06-06 20:40:57 +01:00
2005-12-24 18:00:21 +00:00
:- public(delete_files/1).
:- mode(delete_files(+atom), one).
:- info(delete_files/1, [
comment is 'Deletes a set of matching files.',
argnames is ['Filter'],
exceptions is [
'Filter is not instantiated' - instantiation_error,
'Filter is neither a variable nor a valid regular expression' - type_error(regular_expression, 'Filter'),
'No permission to delete some of the matching files' - permission_error(write, 'File')]]).
2002-05-28 12:29:37 +01:00
:- public(rename_file/2).
:- mode(rename_file(+atom, +atom), zero_or_one).
:- info(rename_file/2, [
2004-07-25 19:47:43 +01:00
comment is 'Renames a file (or a directory).',
2004-06-06 23:46:45 +01:00
argnames is ['Old', 'New'],
exceptions is [
'Old is not instantiated' - instantiation_error,
'New is not instantiated' - instantiation_error,
'Old is neither a variable nor a valid file name' - type_error(file_name, 'Old'),
'New is neither a variable nor a valid file name' - type_error(file_name, 'New'),
2004-07-09 00:48:59 +01:00
'File Old does not exists' - existence_error(file, 'Old'),
'No write permission to the file' - permission_error(write, 'Old')]]).
2004-06-06 23:46:45 +01:00
:- public(copy_file/2).
2004-07-09 00:48:59 +01:00
:- mode(copy_file(+atom, +atom), one).
2004-06-06 23:46:45 +01:00
:- info(copy_file/2, [
comment is 'Makes a copy of a file.',
argnames is ['Original', 'Copy'],
exceptions is [
'Original is not instantiated' - instantiation_error,
'Copy is not instantiated' - instantiation_error,
'Original is neither a variable nor a valid file name' - type_error(file_name, 'Original'),
'Copy is neither a variable nor a valid file name' - type_error(file_name, 'Copy'),
2004-07-09 00:48:59 +01:00
'File Original does not exists' - existence_error(file, 'Original'),
'No read permission to the original file' - permission_error(read, 'Original'),
'No write permission to the file copy' - permission_error(write, 'Copy')]]).
2004-06-06 23:46:45 +01:00
2004-07-25 19:47:43 +01:00
:- public(make_symlink/2).
:- mode(make_symlink(+atom, +atom), one).
:- info(make_symlink/2, [
comment is 'Makes a symbolic link.',
2004-07-09 00:48:59 +01:00
argnames is ['Symlink', 'Target'],
exceptions is [
'Symlink is not instantiated' - instantiation_error,
2004-07-25 19:47:43 +01:00
'Target is not instantiated' - instantiation_error,
2004-07-09 00:48:59 +01:00
'Symlink is neither a variable nor a valid file name' - type_error(file_name, 'Symlink'),
2004-07-25 19:47:43 +01:00
'Target is neither a variable nor a valid file name' - type_error(file_name, 'Target'),
'No permission for creating the symbolic link' - permission_error(write, 'Symlink')]]).
:- public(file_exists/1).
:- mode(file_exists(+atom), zero_or_one).
:- info(file_exists/1, [
comment is 'True if the specified file exists (irrespective of type and file permissions).',
argnames is ['File'],
exceptions is [
'File is not instantiated' - instantiation_error,
'File is neither a variable nor a valid file name' - type_error(file_name, 'File')]]).
2004-07-09 00:48:59 +01:00
:- public(file_property/2).
2004-07-25 19:47:43 +01:00
:- mode(file_property(+atom, +compound), zero_or_one).
:- mode(file_property(+atom, -compound), one_or_more).
2004-07-09 00:48:59 +01:00
:- info(file_property/2, [
comment is 'File properties.',
argnames is ['File', 'Property'],
2004-06-06 23:46:45 +01:00
exceptions is [
'File is not instantiated' - instantiation_error,
'File is neither a variable nor a valid file name' - type_error(file_name, 'File'),
2004-07-09 00:48:59 +01:00
'File does not exists' - existence_error(file, 'File'),
2004-07-25 19:47:43 +01:00
'No read permission to the file' - permission_error(read, 'File'),
2005-12-24 18:00:21 +00:00
'Property is neither a variable nor a valid file property' - type_error(file_property, 'Property')],
examples is [
'Querying file size:' - file_property(foo, size(Bytes)) - {Bytes = 32568},
'Querying file type:' - file_property(foo, type(Type)) - {Type = regular},
2006-02-10 17:44:05 +00:00
'Querying file creation date:' - file_property(foo, creation_time(Time)) - {Time = 137692},
'Querying file last access date:' - file_property(foo, access_time(Time)) - {Time = 811042},
'Querying file modification date:' - file_property(foo, modification_time(Time)) - {Time = 811042},
2005-12-24 18:00:21 +00:00
'Querying file permissions:' - file_property(foo, permission(Permission)) - {Permission = read}
]]).
2004-07-09 00:48:59 +01:00
:- public(current_environment_variable/1).
:- mode(current_environment_variable(?atom), zero_or_more).
:- info(current_environment_variable/1, [
2004-07-25 19:47:43 +01:00
comment is 'Argument is a currently defined environment variable . Fails if the variable does not exists.',
2004-07-09 00:48:59 +01:00
argnames is ['Variable'],
exceptions is [
'Variable is neither a variable nor an atom' - type_error(atom, 'Variable')]]).
2004-06-06 23:46:45 +01:00
2004-07-09 00:48:59 +01:00
:- public(delete_environment_variable/1).
:- mode(delete_environment_variable(+atom), one).
:- info(delete_environment_variable/1, [
comment is 'Deletes an environment variable.',
argnames is ['Variable'],
exceptions is [
'Variable is not instantiated' - instantiation_error,
'Variable is neither a variable nor an atom' - type_error(atom, 'Variable'),
2005-12-24 18:00:21 +00:00
'Variable is not a currently defined environment variable' - existence_error(environment_variable, 'Variable')]]).
2004-07-09 00:48:59 +01:00
:- public(get_environment_variable/2).
:- mode(get_environment_variable(+atom, ?atom), zero_or_one).
:- info(get_environment_variable/2, [
2004-06-06 23:46:45 +01:00
comment is 'Gets environment variable value.',
argnames is ['Variable', 'Value'],
exceptions is [
'Variable is not instantiated' - instantiation_error,
'Variable is neither a variable nor an atom' - type_error(atom, 'Variable'),
2004-07-09 00:48:59 +01:00
'Value is neither a variable nor an atom' - type_error(atom, 'Value'),
2005-12-24 18:00:21 +00:00
'Variable is not a currently defined environment variable' - existence_error(environment_variable, 'Variable')]]).
2004-06-06 23:46:45 +01:00
:- public(set_environment_variable/2).
2004-07-09 00:48:59 +01:00
:- mode(set_environment_variable(+atom, +atom), one).
2004-06-06 23:46:45 +01:00
:- info(set_environment_variable/2, [
comment is 'Sets environment variable value.',
argnames is ['Variable', 'Value'],
exceptions is [
'Variable is not instantiated' - instantiation_error,
'Value is not instantiated' - instantiation_error,
'Variable is neither a variable nor an atom' - type_error(atom, 'Variable'),
'Value is neither a variable nor an atom' - type_error(atom, 'Value')]]).
:- public(time_stamp/1).
:- mode(time_stamp(-number), one).
:- info(time_stamp/1, [
2004-07-25 19:47:43 +01:00
comment is 'Returns a system-dependent time stamp (which can be used for sorting).',
2004-06-06 23:46:45 +01:00
argnames is ['Time']]).
2004-07-09 00:48:59 +01:00
:- public(local_time/1).
:- mode(local_time(?time(?integer, ?integer, ?integer, ?integer, ?integer, ?integer, ?integer)), zero_or_one).
:- info(local_time/1, [
comment is 'Local time (respecting time zone and daylight savings settings).',
2004-12-25 03:06:18 +00:00
argnames is ['time(Year, Month, Day, Hours, Mins, Secs, Microsecs)']]).
2004-07-09 00:48:59 +01:00
:- public(utc_time/1).
:- mode(utc_time(?time(?integer, ?integer, ?integer, ?integer, ?integer, ?integer, ?integer)), zero_or_one).
:- info(utc_time/1, [
2004-07-25 19:47:43 +01:00
comment is 'Universal Coordinated Time (UTC).',
2004-12-25 03:06:18 +00:00
argnames is ['time(Year, Month, Day, Hours, Mins, Secs, Microsecs)']]).
2004-07-09 00:48:59 +01:00
:- public(convert_time/2).
:- mode(convert_time(+number, ?time(?integer, ?integer, ?integer, ?integer, ?integer, ?integer, ?integer)), zero_or_one).
2004-07-25 19:47:43 +01:00
:- mode(convert_time(?number, +time(+integer, +integer, +integer, +integer, +integer, +integer, +integer)), zero_or_one).
2004-07-09 00:48:59 +01:00
:- info(convert_time/2, [
2004-07-25 19:47:43 +01:00
comment is 'Converts between system-dependent time stamps and calendar local date and time.',
2004-12-25 03:06:18 +00:00
argnames is ['Time', 'time(Year, Month, Day, Hours, Mins, Secs, Microsecs)'],
2004-06-06 23:46:45 +01:00
exceptions is [
2004-07-25 19:47:43 +01:00
'Neither argument is instantiated' - instantiation_error,
'Time stamp is neither a variable nor a valid time stamp' - type_error(time_stamp, 'Time'),
'Time structure is neither a variable nor a valid time structure' - type_error(time_structure, 'time(Year, Month, Day, Hours, Mins, Secs, Microsecs)')]]).
2004-06-06 23:46:45 +01:00
:- public(cpu_time/1).
2004-07-09 00:48:59 +01:00
:- mode(cpu_time(-number), one).
2004-06-06 23:46:45 +01:00
:- info(cpu_time/1, [
comment is 'System cpu time in seconds.',
argnames is ['Time']]).
:- public(host_name/1).
:- mode(host_name(-atom), one).
:- info(host_name/1, [
2004-07-09 00:48:59 +01:00
comment is 'Host name (default is localhost).',
2004-06-06 23:46:45 +01:00
argnames is ['Name']]).
2004-08-02 17:08:31 +01:00
:- public(portable_os_file_name/2).
:- mode(portable_os_file_name(+atom, -atom), one).
:- mode(portable_os_file_name(-atom, +atom), one).
:- info(portable_os_file_name/2, [
comment is 'Converts between portable and operating-system dependent file names.',
2004-06-06 23:46:45 +01:00
argnames is ['Canonical', 'OS']]).
2004-08-02 17:08:31 +01:00
:- public(portable_file_name/3).
:- mode(portable_file_name(+atom, -atom, -atom), one).
:- mode(portable_file_name(-atom, +atom, -atom), one).
:- mode(portable_file_name(-atom, -atom, +atom), one).
:- info(portable_file_name/3, [
comment is 'Converts between relative, absolute, and URL portable file names.',
2004-07-09 00:48:59 +01:00
argnames is ['Relative', 'Absolute', 'URL'],
2004-06-06 23:46:45 +01:00
exceptions is [
'None of the arguments is instantiated' - instantiation_error,
2004-07-25 19:47:43 +01:00
'Relative is neither a variable nor a relative file name' - type_error(relative_file_name, 'Relative'),
'Absolute is neither a variable nor a absolute file name' - type_error(absolute_file_name, 'Absolute'),
2004-07-09 00:48:59 +01:00
'URL is neither a variable nor a file name URL' - type_error(url_file_name, 'URL')]]).
2004-06-06 23:46:45 +01:00
:- public(relative_file_name/1).
:- mode(relative_file_name(+atom), zero_or_one).
:- info(relative_file_name/1, [
2004-08-02 17:08:31 +01:00
comment is 'True when the argument is a valid, relative file name. Argument is expanded to a canonical file name before testing.',
2004-06-06 23:46:45 +01:00
argnames is ['File'],
exceptions is [
'File is not instantiated' - instantiation_error,
'File is neither a variable nor a valid file name' - type_error(file_name, 'File')]]).
:- public(absolute_file_name/1).
:- mode(absolute_file_name(+atom), zero_or_one).
:- info(absolute_file_name/1, [
2004-08-02 17:08:31 +01:00
comment is 'True if the argument is a valid, absolute file name. Argument is expanded to a canonical file name before testing.',
2004-06-06 23:46:45 +01:00
argnames is ['File'],
exceptions is [
'File is not instantiated' - instantiation_error,
'File is neither a variable nor a valid file name' - type_error(file_name, 'File')]]).
2004-07-09 00:48:59 +01:00
:- public(url_file_name/1).
:- mode(url_file_name(+atom), zero_or_one).
:- info(url_file_name/1, [
2004-08-02 17:08:31 +01:00
comment is 'True when the argument is a valid, URL file name. Argument is expanded to a canonical file name before testing.',
2004-06-06 23:46:45 +01:00
argnames is ['File'],
exceptions is [
'File is not instantiated' - instantiation_error,
'File is neither a variable nor a valid file name' - type_error(file_name, 'File')]]).
:- public(absolute_file_name/2).
:- mode(absolute_file_name(+atom, ?atom), zero_or_one).
:- info(absolute_file_name/2, [
2004-08-02 17:08:31 +01:00
comment is 'Expands a file name into a canonical absolute file name.',
2004-06-06 23:46:45 +01:00
argnames is ['File', 'Absolute'],
exceptions is [
'File is not instantiated' - instantiation_error,
'File is neither a variable nor a valid file name' - type_error(file_name, 'File'),
'Absolute is neither a variable nor a valid file name' - type_error(file_name, 'Absolute')]]).
2004-07-09 00:48:59 +01:00
:- public(url_file_name/2).
:- mode(url_file_name(+atom, ?atom), zero_or_one).
:- info(url_file_name/2, [
2004-08-02 17:08:31 +01:00
comment is 'Expands a file name into a canonical URL file name.',
2004-07-09 00:48:59 +01:00
argnames is ['File', 'URL'],
2004-06-06 23:46:45 +01:00
exceptions is [
'File is not instantiated' - instantiation_error,
'File is neither a variable nor a valid file name' - type_error(file_name, 'File'),
2004-07-09 00:48:59 +01:00
'URL is neither a variable nor a valid file name URL' - type_error(file_name, 'URL')]]).
2004-06-06 23:46:45 +01:00
2004-07-09 00:48:59 +01:00
:- public(file_name_part/2).
2004-07-25 19:47:43 +01:00
:- mode(file_name_part(+atom, ?compound), zero_or_more).
2004-07-09 00:48:59 +01:00
:- info(file_name_part/2, [
2004-08-02 17:08:31 +01:00
comment is 'File name parts. The file name is expanded to a canonical file name before decomposing in parts.',
2004-07-09 00:48:59 +01:00
argnames is ['File', 'Part'],
2004-06-06 23:46:45 +01:00
exceptions is [
'File is not instantiated' - instantiation_error,
'File is neither a variable nor a valid file name' - type_error(file_name, 'File'),
2004-07-09 00:48:59 +01:00
'File does not exists' - existence_error(file, 'File'),
2005-12-24 18:00:21 +00:00
'Part is neither a variable nor a file name part' - type_error(file_name_part, 'Port')],
examples is [
'Querying file access protocol:' - file_name_part(foo, protocol(Protocol)) - {Protocol = file},
'Querying file host location:' - file_name_part('http://www.prolog-standard.org:8080/index.html', host(Host)) - {Host = 'www.prolog-standard.org'},
2006-02-10 17:44:05 +00:00
'Querying file port:' - file_name_part('http://www.prolog-standard.org:8080/index.html', port(Port)) - {Port = 8080},
'Querying file port:' - file_name_part(foo, port(Port)) - {no},
'Querying file username:' - file_name_part('http://user@www.prolog-standard.org/', user(Username)) - {Username = user},
'Querying file password:' - file_name_part('http://user:password@www.prolog-standard.org/', password(Password)) - {Password = password},
'Querying file base name:' - file_name_part('/usr/local/foo.pl', base(Basename)) - {Basename = 'foo.pl'},
'Querying file path:' - file_name_part('/usr/local/foo.pl', path(Path)) - {Path = '/usr/local/'},
2005-12-24 18:00:21 +00:00
'Querying file extension:' - file_name_part('foo.pl', extension(Extension)) - {Extension = '.pl'},
'Querying file extension:' - file_name_part('foo.', extension(Extension)) - {Extension = '.'},
'Querying file extension:' - file_name_part(foo, extension(Extension)) - {Extension = ''},
2006-02-10 17:44:05 +00:00
'Querying file search pairs:' - file_name_part('http://user@www.prolog-standard.org/updates.cgi?date=today', search(Pairs)) - {Pairs = [date=today]},
'Querying file fragment:' - file_name_part('http://user@www.prolog-standard.org/updates.html#latest', fragment(Fragment)) - {Fragment = latest}
2005-12-24 18:00:21 +00:00
]]).
2004-06-06 23:46:45 +01:00
:- public(file_name_parts/2).
2004-07-25 19:47:43 +01:00
:- mode(file_name_parts(+atom, -list(compound)), one).
:- mode(file_name_parts(-atom, +list(compound)), zero_or_one).
2004-06-06 23:46:45 +01:00
:- info(file_name_parts/2, [
2004-08-02 17:08:31 +01:00
comment is 'Converts between a file name and its constituent parts (represented as a list of compound terms). The file name (when instantiated) is expanded to a canonical file name before decomposing in parts.',
2004-06-06 23:46:45 +01:00
argnames is ['File', 'Parts'],
exceptions is [
'None of the arguments are instantiated' - instantiation_error,
'File is neither a variable nor a valid file name' - type_error(file_name, 'File'),
2005-12-24 18:00:21 +00:00
'Parts is neither a variable nor a list' - type_error(list(compound), 'Parts')],
examples is [
'Decomposing a file name:' - file_name_parts('http://www.prolog-standard.org:8080/index.html', Parts) - {Parts = [protocol(http), host('www.prolog-standard.org'), port(8080), path('/'), base(index), extension('.html')]}]]).
2002-08-26 17:45:50 +01:00
2001-06-06 20:40:57 +01:00
:- end_protocol.