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.
6 .. index:: RENAME, file system, rename file
10 RENAME --- Rename a file
11 ************************
13 .. function:: RENAME(PATH1, PATH2)
15 Renames a file from file :samp:`{PATH1}` to :samp:`{PATH2}`. A null
16 character (``CHAR(0)``) can be used to mark the end of the names in
17 :samp:`{PATH1}` and :samp:`{PATH2}` ; otherwise, trailing blanks in the file
18 names are ignored. If the :samp:`{STATUS}` argument is supplied, it
19 contains 0 on success or a nonzero error code upon return; see
23 Shall be of default ``CHARACTER`` type.
26 Shall be of default ``CHARACTER`` type.
29 (Optional) Shall be of default ``INTEGER`` type.
38 .. code-block:: fortran
40 CALL RENAME(PATH1, PATH2 [, STATUS])
41 STATUS = RENAME(PATH1, PATH2)