1
1
! SPDX-Identifier: MIT
2
2
3
3
!> Interaction with the filesystem.
4
- module stdlib_io_filesystem
4
+ module stdlib_filesystem
5
5
use stdlib_string_type, only: string_type
6
6
implicit none
7
7
private
8
8
9
9
public :: temp_dir, is_windows, exists, path_separator, list_dir, mkdir, rmdir, run
10
10
11
11
#: if OS == 'Windows'
12
+ !> Whether the operating system is Windows.
12
13
logical, parameter :: is_windows = .true.
14
+ !> Path separator for Windows.
13
15
character, parameter :: path_separator = '\'
14
16
#: else
17
+ !> Whether the operating system is Windows.
15
18
logical, parameter :: is_windows = .false.
19
+ !> Path separator for filesystems on non-Windows operating systems.
16
20
character, parameter :: path_separator = '/'
17
21
#: endif
18
22
@@ -22,7 +26,7 @@ contains
22
26
!> Version: experimental
23
27
!>
24
28
!> Whether a file or directory exists at the given path.
25
- !> [Specification](../page/specs/stdlib_io .html#exists)
29
+ !> [Specification](../page/specs/stdlib_filesystem .html#exists)
26
30
logical function exists(path)
27
31
!> Path to a file or directory.
28
32
character(len=*), intent(in) :: path
@@ -37,7 +41,7 @@ contains
37
41
!> Version: experimental
38
42
!>
39
43
!> List files and directories of a directory. Does not list hidden files.
40
- !> [Specification](../page/specs/stdlib_io .html#list_dir)
44
+ !> [Specification](../page/specs/stdlib_filesystem .html#list_dir)
41
45
subroutine list_dir(dir, files, iostat, iomsg)
42
46
!> Directory to list.
43
47
character(len=*), intent(in) :: dir
@@ -95,7 +99,7 @@ contains
95
99
!> Version: experimental
96
100
!>
97
101
!> Create a directory.
98
- !> [Specification](../page/specs/stdlib_io .html#mkdir)
102
+ !> [Specification](../page/specs/stdlib_filesystem .html#mkdir)
99
103
subroutine mkdir(dir, iostat, iomsg)
100
104
character(len=*), intent(in) :: dir
101
105
integer, optional, intent(out) :: iostat
@@ -111,7 +115,7 @@ contains
111
115
!> Version: experimental
112
116
!>
113
117
!> Remove a directory including its contents.
114
- !> [Specification](../page/specs/stdlib_io .html#rmdir)
118
+ !> [Specification](../page/specs/stdlib_filesystem .html#rmdir)
115
119
subroutine rmdir(dir)
116
120
character(len=*), intent(in) :: dir
117
121
@@ -125,7 +129,7 @@ contains
125
129
!> Version: experimental
126
130
!>
127
131
!> Run a command in the shell.
128
- !> [Specification](../page/specs/stdlib_io .html#run)
132
+ !> [Specification](../page/specs/stdlib_filesystem .html#run)
129
133
subroutine run(command, iostat, iomsg)
130
134
!> Command to run.
131
135
character(len=*), intent(in) :: command
0 commit comments