File: example_make_directory.f90

package info (click to toggle)
fortran-stdlib 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,008 kB
  • sloc: f90: 24,178; ansic: 1,244; cpp: 623; python: 119; makefile: 13
file content (25 lines) | stat: -rw-r--r-- 632 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
! Illustrate the usage of `make_directory`, `make_directory_all`
program example_make_directory
    use stdlib_system, only: make_directory, make_directory_all
    use stdlib_error, only: state_type
    implicit none

    type(state_type) :: err

    call make_directory("temp_dir", err)

    if (err%error()) then
        print *, err%print()
    else
        print *, "directory created sucessfully"
    end if

    call make_directory_all("d1/d2/d3/d4", err)

    if (err%error()) then
        print *, err%print()
    else
        print *, "nested directories created sucessfully"
    end if

end program example_make_directory