We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3ddc1d commit d047e1fCopy full SHA for d047e1f
example/system/example_get_file_size.f90
@@ -1,10 +1,21 @@
1
program example_get_file_size
2
+ use, intrinsic :: iso_fortran_env, only: int64
3
use stdlib_system, only: get_file_size
4
+ use stdlib_error, only: state_type
5
implicit none
6
+
7
+ type(state_type) :: err
8
+ integer(int64) :: size
9
- character(*), parameter :: path = "src"
10
+ character(*), parameter :: path = "path/to/check"
11
12
+ size = get_file_size(path, err)
13
- print *, get_file_size(path)
14
+ if (err%ok()) then
15
+ print *, "Size in bytes = ", size
16
+ else
17
+ print *, "Error!: ", err%print()
18
+ end if
19
20
end program example_get_file_size
21
0 commit comments