Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Intel Customer Support will be observing the Martin Luther King holiday on Monday, Jan. 17, and will return on Tues. Jan. 18.
For the latest information on Intel’s response to the Log4j/Log4Shell vulnerability, please see Intel-SA-00646

RENAME function returns 13?


Calling RENAME returns a value of 13 in my code (the from name is a directory and it exists, the to name doesn't exist) , and this error code isn't listed in the run-time error list. Is there a definition for this value? 

The documentation says it returns an Integer 4 and lists choices of ENOENT, EACCES, and EXDEV, but there is not a link to these names and no value is provided in the documentation.  How do you figure out if you have gotten those return values?

0 Kudos
2 Replies
Black Belt Retired Employee

First, the code constants are defined in IFPORT. 13 is EACCESS or "permission denied".

      INTEGER(4), PARAMETER :: EPERM   = 1   ! Insufficient Permission for Operation
      INTEGER(4), PARAMETER :: ENOENT  = 2   ! No Such File or Directory
      INTEGER(4), PARAMETER :: ESRCH   = 3   ! No Such Process
      INTEGER(4), PARAMETER :: EIO     = 5   ! I/O error
      INTEGER(4), PARAMETER :: E2BIG   = 7   ! Argument List Too Long
      INTEGER(4), PARAMETER :: ENOEXEC = 8   ! File Is Not Executable
      INTEGER(4), PARAMETER :: ENOMEM  = 12  ! Not Enough Resources
      INTEGER(4), PARAMETER :: EACCES  = 13  ! Permission Denied
      INTEGER(4), PARAMETER :: EXDEV   = 18  ! Cross Device Link
      INTEGER(4), PARAMETER :: ENOTDIR = 20  ! Not a Directory
      INTEGER(4), PARAMETER :: EINVAL  = 22  ! Invalid Argument



Thanks Steve! Never realized that was there.  C:\Program Files (x86)\Intel\Composer XE 2015\compiler\include\ifport.f90 for future reference.