]>
Commit | Line | Data |
---|---|---|
1 | .. | |
2 | Copyright 1988-2022 Free Software Foundation, Inc. | |
3 | This is part of the GCC manual. | |
4 | For copying conditions, see the copyright.rst file. | |
5 | ||
6 | .. index:: GETCWD, system, working directory | |
7 | ||
8 | .. _getcwd: | |
9 | ||
10 | GETCWD --- Get current working directory | |
11 | **************************************** | |
12 | ||
13 | .. function:: GETCWD(C) | |
14 | ||
15 | Get current working directory. | |
16 | ||
17 | :param C: | |
18 | The type shall be ``CHARACTER`` and of default kind. | |
19 | ||
20 | :param STATUS: | |
21 | (Optional) status flag. Returns 0 on success, | |
22 | a system specific and nonzero error code otherwise. | |
23 | ||
24 | Standard: | |
25 | GNU extension | |
26 | ||
27 | Class: | |
28 | Subroutine, function | |
29 | ||
30 | Syntax: | |
31 | .. code-block:: fortran | |
32 | ||
33 | CALL GETCWD(C [, STATUS]) | |
34 | STATUS = GETCWD(C) | |
35 | ||
36 | Example: | |
37 | .. code-block:: fortran | |
38 | ||
39 | PROGRAM test_getcwd | |
40 | CHARACTER(len=255) :: cwd | |
41 | CALL getcwd(cwd) | |
42 | WRITE(*,*) TRIM(cwd) | |
43 | END PROGRAM | |
44 | ||
45 | See also: | |
46 | :ref:`CHDIR` |