Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

RENAME function returns 13?

dajum
Novice
106 Views

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
Steve_Lionel
Black Belt Retired Employee
106 Views

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

 

dajum
Novice
106 Views

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

Reply