library(file_systems)This module provides operations on files and directories, such as renaming, deleting, opening, checking permissions, accessing members of.
The following principles have been observed:
absolute_file_name/3.
file_exists/1 will fail if passed
such a “broken” link and that neither
file_members_of_directory/1 nor
directory_members_of_directory/1 et al. will return such
a link.
On Windows, symbolic links (and other reparse points) are
not followed when enumerating directory contents with
file_members_of_directory/1 nor
directory_members_of_directory/1 et al. and are not
returned for these predicates.
The behavior for symbolic links (and reparse points) may change on all platforms in the future to ensure a well defined and consistent behavior on all platforms.
To see all members of a directory you can use
absolute_file_name/3 with a glob('*') option.
The “property” routines use the same simplistic access control
model as that used by the absolute_file_name/3
access/1-option. See mpg-ref-absolute_file_name, for details.
Exported predicates:
rename_file(+OldName, +NewName)rename_directory(+OldName, +NewName)delete_file(+OldName)delete_directory(+Directory)delete_directory(+Directory, +Options)if_nonempty(Value)ignorefailerrordeletedirectory_exists(+Directory)directory_exists(+Directory, +Mode)exist.
This is more or less equivalent to
absolute_file_name(File, _, [file_type(directory),access([exist|Mode]),file_errors(fail)]).
make_directory(+Directory)absolute_file_name/3,
and the resulting directory is created.
file_exists(+File)file_exists(+File, +Mode)exist.
This is more or less equivalent to
absolute_file_name(File, _, [access([exist|Mode]),file_errors(fail)]).
file_must_exist(+File)file_must_exist(+File, +Mode)file_exists(File[, Mode]) except that if the file is not
accessible it reports an error.
This is more or less equivalent to
absolute_file_name(File, _, [access([exist|Mode]),file_errors(error)]).
directory_must_exist(+File)directory_must_exist(+File, +Mode)file_must_exists(File[, Mode]), but for directories.
This is more or less equivalent to
absolute_file_name(File, _, [file_type(directory),access([exists|Mode]),file_errors(error)]).
close_all_streamsabort/0. Note that current_stream/3 does not notice the standard
streams.
directory_member_of_directory(?BaseName, ?FullName)This uses absolute_file_name/3 with the glob/1 option.
directory_member_of_directory(+Directory, ?BaseName, ?FullName)This uses absolute_file_name/3 with the glob/1 option.
directory_member_of_directory(+Directory, +Pattern, ?BaseName, ?FullName)This uses absolute_file_name/3 with a glob(Pattern) option.
directory_members_of_directory(-Set)This uses absolute_file_name/3 with the glob/1 option.
directory_members_of_directory(+Directory, -Set)This uses absolute_file_name/3 with the glob/1 option.
directory_members_of_directory(+Directory, +Pattern, -Set)This uses absolute_file_name/3 with a glob(Pattern) option.
file_member_of_directory(?BaseName, ?FullName)This uses absolute_file_name/3 with the glob/1 option.
file_member_of_directory(+Directory, ?BaseName, ?FullName)This uses absolute_file_name/3 with the glob/1 option.
file_member_of_directory(+Directory, +Pattern, ?BaseName, ?FullName)This uses absolute_file_name/3 with a glob(Pattern) option.
file_members_of_directory(-Set)This uses absolute_file_name/3 with the glob/1 option.
file_members_of_directory(+Directory, -Set)This uses absolute_file_name/3 with the glob/1 option.
file_members_of_directory(+Directory, +Pattern, -Set)This uses absolute_file_name/3 with a glob(Pattern) option.
directory_property(+Directory, ?Property)directory_property(., searchable).
The current set of file and directory properties include:
readablewritableexecutablesearchablesize_in_bytescreate_timestampmodify_timestampaccess_timestampThe timestamp is what should be used when comparing information
between files since it is independent of locale issues like time zone and daylight
savings time etc.
create_localtimemodify_localtimeaccess_localtime..._timestamp values passed
through system:datime/2, i.e. expressed as local time and
split up in the components year, month, day, hour, minute, seconds.
set_user_idset_group_idsave_textwho_can_readwho_can_writewho_can_executewho_can_search[user,group,other] for the
process classes that can, respectively, read, write, execute (only for
files) or search (only for directories.
owner_user_idowner_group_idowner_user_nameowner_group_group'DOMAIN\NAME' will be used.
If for some reason the name cannot be found it will fall back to using
the same value as owner_user_id and owner_group_id.
Other properties may be added in the future. You can backtrack through
the available properties by calling file_property/3 or
directory_property/3 with an uninstantiated Property
argument.
directory_property(+Directory, ?Property, ?Value)directory_property/2, above, for a list of properties.
file_property(+File, ?Property) file_property('foo.txt', readable).
See directory_property/2, above, for a list of properties.
file_property(+File, ?Property, ?Value)directory_property/2, above, for a list of properties.
current_directory(-Directory)current_directory(-Directory, +NewDirectory)