CHMOD — Change access permissions of files#
- 
CHMOD(NAME, MODE, STATUS)#
- CHMODchanges the permissions of a file.- Parameters:
- NAME – Scalar - CHARACTERof default kind with the file name. Trailing blanks are ignored unless the character- achar(0)is present, then all characters up to and excluding- achar(0)are used as the file name.
- MODE – Scalar - CHARACTERof default kind giving the file permission.- MODEuses the same syntax as the- chmodutility as defined by the POSIX standard. The argument shall either be a string of a nonnegative octal number or a symbolic mode.
- STATUS – (optional) scalar - INTEGER, which is- 0on success and nonzero otherwise.
 
- Returns:
- In either syntax, - STATUSis set to- 0on success and nonzero otherwise.
 - Standard:
- GNU extension 
- Class:
- Subroutine, function 
- Syntax:
- CALL CHMOD(NAME, MODE[, STATUS]) STATUS = CHMOD(NAME, MODE) 
- Example:
- CHMODas subroutine- program chmod_test implicit none integer :: status call chmod('test.dat','u+x',status) print *, 'Status: ', status end program chmod_test - CHMODas function:- program chmod_test implicit none integer :: status status = chmod('test.dat','u+x') print *, 'Status: ', status end program chmod_test