V3FIT
Functions/Subroutines | Variables
file_opts Module Reference

Contains cross platform routines for manipulating files on the file system. Defines a functions to move, copy and delete a file that is cross platform. While, system contains a crossplatform way to call a command line commands, the command used will vary by platform. More...

Functions/Subroutines

subroutine move_file (file_source, file_dest, error)
 Moves the source file to the destination. More...
 
subroutine copy_file (file_source, file_dest, error)
 Copies the source file to the destination. More...
 
subroutine delete_file (file_source, error)
 Deletes a file. More...
 
subroutine create_directory (directory_source, error)
 Makes a directory. More...
 
subroutine delete_directory (directory_source, error)
 Deletes a directory. More...
 
logical function is_absolute_path (path)
 Queries if the a path is absoulte. More...
 
character(len=path_length) function get_path_of_file (file)
 Returns the directory of a file. More...
 
character(len=path_length) function build_path (path, name)
 Builds a path. More...
 
subroutine change_directory (path, error)
 Change working directory. More...
 

Variables

integer, parameter path_length = 300
 Length of file paths.
 

Detailed Description

Contains cross platform routines for manipulating files on the file system. Defines a functions to move, copy and delete a file that is cross platform. While, system contains a crossplatform way to call a command line commands, the command used will vary by platform.

Function/Subroutine Documentation

◆ build_path()

character (len=path_length) function file_opts::build_path ( character (len=*), intent(in)  path,
character (len=*), intent(in)  name 
)

Builds a path.

Builds a path by concatenating a string onto a path.

Parameters
[in]pathExisting path.
[in]nameString to add to path.
Returns
The new path.

Definition at line 382 of file file_opts.f.

◆ change_directory()

subroutine file_opts::change_directory ( character (len=*), intent(in)  path,
integer, intent(out)  error 
)

Change working directory.

Changes the current working directory of the running process. CHDIR is an extension on many compilers. Check for compatability.

Parameters
[in]pathPath of the working directory to change to.
[out]errorReturned error code.

Definition at line 414 of file file_opts.f.

◆ copy_file()

subroutine file_opts::copy_file ( character (len=*), intent(in)  file_source,
character (len=*), intent(in)  file_dest,
integer, intent(out)  error 
)

Copies the source file to the destination.

Copies a file by calling the appropriate command for the platform. If the destination is an existing file, that file will be overwritten.

Parameters
[in]file_sourceThe file to copy.
[in]file_destThe destination of the copied file.
[out]errorThe result of the copy.

Definition at line 78 of file file_opts.f.

◆ create_directory()

subroutine file_opts::create_directory ( character (len=*), intent(in)  directory_source,
integer, intent(out)  error 
)

Makes a directory.

Creates new directory by calling the appropriate command for the plaform.

Parameters
[in]directory_sourceThe directory to create.
[out]errorThe result of the copy.

Definition at line 249 of file file_opts.f.

◆ delete_directory()

subroutine file_opts::delete_directory ( character (len=*), intent(in)  directory_source,
integer, intent(out)  error 
)

Deletes a directory.

Deletes directory by calling the appropriate command for the plaform. This deletes all files inside the directory as well.

Parameters
[in]directory_sourceThe directory to delete.
[out]errorThe result of the copy.

Definition at line 279 of file file_opts.f.

◆ delete_file()

subroutine file_opts::delete_file ( character (len=*), intent(in)  file_source,
integer, intent(out)  error 
)

Deletes a file.

Deletes a file by calling the appropriate command for the platform. Ignores errors if the file doesn't exisit.

Parameters
[in]file_sourceThe file to delete.
[out]errorThe result of the copy.

Definition at line 215 of file file_opts.f.

◆ get_path_of_file()

character (len=path_length) function file_opts::get_path_of_file ( character (len=*), intent(in)  file)

Returns the directory of a file.

Searches a path for last path separator and returns the directory path.

Parameters
[in]filePath to file.
Returns
The path of the file.

Definition at line 354 of file file_opts.f.

◆ is_absolute_path()

logical function file_opts::is_absolute_path ( character (len=*), intent(in)  path)

Queries if the a path is absoulte.

Determines if the root of a path exists or if the path is relative. If the path is absoulte return true. If the path is relative return false. An empty path is treated as absoulte.

Parameters
[in]pathPath to test.
Returns
True if the path is absolute.

Definition at line 309 of file file_opts.f.

◆ move_file()

subroutine file_opts::move_file ( character (len=*), intent(in)  file_source,
character (len=*), intent(in)  file_dest,
integer, intent(out)  error 
)

Moves the source file to the destination.

Moves a file by calling the appropriate command for the platform. If the destination is an existing file, that file will be overwritten.

Parameters
[in]file_sourceThe file to move.
[in]file_destThe destination of the moved file.
[out]errorThe result of the move.

Definition at line 37 of file file_opts.f.