This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Using chmod fails under MinGW
> Arjen Markus wrote:
>
>> Apparently the chmod subroutine is recognised as an intrinsic,
>> but there is no suitable implementation.
>
> The libgfortran implementation just runs an external chmod binary, but
> there is no chmod command on native Windows so this would be pointless
> as it would fail. Some users might have MSYS or Cygwin installed and
> thus have an available chmod binary, but users who expect to use just
> plain MinGW would not.
>
> In other words, the semantics of implementing chmod on Windows require
> some kind of POSIX translation layer, which is not what MinGW is about.
>
Brian,
I can understand that - in fact, a lot of other POSIX routines are
simply not available, like getuid(). But in these cases the linker
complains about _getuid being an unresolved external.
In the case of chmod(), the compiler seems to recognise it as an
_intrinsic_, given that the symbol the linker is complaining about
is not called _chmod but __gfortran_chmod_func and the like.
So, I do think this is a small glitch in the compiler. I just
confirmd this:
intrinsic :: chmod
call chmod( 'somefile', 'u+r', status )
will give no compiler warning (so chmod() is an intrinsic),
but the linker does not find __gfortran_chmod_i4_sub.
Regards,
Arjen