slashrename#
- Files.slashrename(fname1='', ext1='', fname2='', ext2='', distkey='', **kwargs)#
Renames a file.
Mechanical APDL Command: /RENAME
- Parameters:
- fname1
str
The file to be renamed. You can also include an optional directory path as part of the specified file name; if not, the default file location is the working directory.
File name defaults to the current
Jobname
.- ext1
str
Filename extension (eight-character maximum).
- fname2
str
The new name for the file. You can also include an optional directory path as part of the new file name; if not, the default is the working directory. A maximum of 248 characters is allowed for the file name (or combined file name and directory path, if both are specified).
Fname2
defaults toFname1
.- ext2
str
Filename extension (eight-character maximum).
Ext2
defaults toExt1
.- distkey
str
Key that specifies which rename operation is performed on all processes in distributed-memory parallel mode:
0 (OFF or NO)
- The program performs the rename operation only on the master process (default).1 (ON or YES)
- The program performs the rename operation locally on each process.2 or BOTH
- The program performs the rename operation forFname
.Ext
on the master process and forFnameN
.Ext
on all processes.
- fname1
Notes
Renames a file. Ex: slashrename,A,,,B renames file A to B in the same directory. slashrename,A,DAT,,,INP renames file A.DAT to A.INP. On all systems, this command will overwrite any existing file named B. See the Operations Guide for details. Only Mechanical APDL binary files should be renamed. Use sys and system renaming commands for other files.
In distributed-memory parallel (DMP) mode, only the master process will rename
Fname1
.Ext1
toFname2
.Ext2
by default. However, whenDistKey
is set to 1 (or ON, or YES) or 2 (or BOTH), the command is executed by all processes. In this case,Fname1
andFname2
will automatically have the process rank appended to them. This meansFname1N
.Ext1
will be renamed toFname2N
.Ext2
by all processes, whereN
is the DMP process rank. For more information see in the Parallel Processing Guide.Renaming across system partitions may be internally done by a copy and delete operation on some systems.
This command is valid only at the Begin level.