Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
20 Views

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
Highlighted
Black Belt Retired Employee
20 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

 

0 Kudos
Highlighted
Beginner
20 Views

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

0 Kudos