Skip to content

Commit a3ddc1d

Browse files
committed
added docs
1 parent 157d63f commit a3ddc1d

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

doc/specs/stdlib_system.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,46 @@ Subroutine
720720

721721
---
722722

723+
## `get_file_size` - Gets the size (in bytes) of a file.
724+
725+
### Status
726+
727+
Experimental
728+
729+
### Description
730+
731+
This function gets the size (in bytes) of a file in the filesystem.
732+
It follows symbolic links, returns an error if the symbolic link or the `path` points to a directory instead.
733+
It is designed to work across multiple platforms. On Windows, paths with both forward `/` and backward `\` slashes are accepted.
734+
735+
### Syntax
736+
737+
`res = [[stdlib_system(module):get_file_size(function)]] (path [, err])`
738+
739+
### Class
740+
741+
Function
742+
743+
### Arguments
744+
745+
`path`: Shall be a character string containing the path of the file. It is an `intent(in)` argument.
746+
747+
`err`(optional): Shall be of type `state_type`, and is used for error handling. It is an `intent(out)` argument.
748+
749+
### Return values
750+
751+
`res`: it is the size (in bytes). It is of type `integer(kind=int64)`.
752+
753+
`err`: it is an optional state return flag. On error if not requested, an `FS_ERROR` will trigger an error stop.
754+
755+
### Example
756+
757+
```fortran
758+
{!example/system/example_get_file_size.f90!}
759+
```
760+
761+
---
762+
723763
## `null_device` - Return the null device file path
724764

725765
### Status

0 commit comments

Comments
 (0)