Skip to content

Commit 2b3f141

Browse files
committed
add docs for the new functions
1 parent 2c738a8 commit 2b3f141

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

doc/specs/stdlib_system.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,45 @@ Formats all the arguments into a nice error message, utilizing the constructor o
497497

498498
---
499499

500+
## `is_regular_file` - Test if a path is a regular file
501+
502+
### Status
503+
504+
Experimental
505+
506+
### Description
507+
508+
This function checks if a specified file system path is a regular file.
509+
It follows symbolic links and returns the status of the `target`.
510+
It is designed to work across multiple platforms. On Windows, paths with both forward `/` and backward `\` slashes are accepted.
511+
512+
### Syntax
513+
514+
`result = ` [[stdlib_system(module):is_regular_file(function)]]`(path)`
515+
516+
### Class
517+
518+
Function
519+
520+
### Arguments
521+
522+
`path`: Shall be a character string containing the file system path to evaluate. It is an `intent(in)` argument.
523+
524+
### Return values
525+
526+
The function returns a `logical` value:
527+
528+
- `.true.` if the path matches an existing regular file.
529+
- `.false.` otherwise, or if path does not exist.
530+
531+
### Example
532+
533+
```fortran
534+
{!example/system/example_is_regular_file.f90!}
535+
```
536+
537+
---
538+
500539
## `is_directory` - Test if a path is a directory
501540

502541
### Status
@@ -506,6 +545,7 @@ Experimental
506545
### Description
507546

508547
This function checks if a specified file system path is a directory.
548+
It follows symbolic links and returns the status of the `target`.
509549
It is designed to work across multiple platforms. On Windows, paths with both forward `/` and backward `\` slashes are accepted.
510550

511551
### Syntax
@@ -535,6 +575,46 @@ The function returns a `logical` value:
535575

536576
---
537577

578+
## `is_symlink` - Test if a path is a symbolic link.
579+
580+
### Status
581+
582+
Experimental
583+
584+
### Description
585+
586+
This function checks if a specified file system path is a symbolic link to either a file or a directory.
587+
Use [[stdlib_system(module):is_regular_file(function)]] and [[stdlib_system(module):is_directory(function)]] functions
588+
to check further if the link is to a file or a directory respectively.
589+
It is designed to work across multiple platforms. On Windows, paths with both forward `/` and backward `\` slashes are accepted.
590+
591+
### Syntax
592+
593+
`result = ` [[stdlib_system(module):is_symlink(function)]]`(path)`
594+
595+
### Class
596+
597+
Function
598+
599+
### Arguments
600+
601+
`path`: Shall be a character string containing the file system path to evaluate. It is an `intent(in)` argument.
602+
603+
### Return values
604+
605+
The function returns a `logical` value:
606+
607+
- `.true.` if the path matches an existing regular file.
608+
- `.false.` otherwise, or if the path does not exist.
609+
610+
### Example
611+
612+
```fortran
613+
{!example/system/example_is_symlink.f90!}
614+
```
615+
616+
---
617+
538618
## `make_directory` - Creates an empty directory
539619

540620
### Status

0 commit comments

Comments
 (0)