Check that file exists: Difference between revisions
Content added Content deleted
m (→{{header|Fortran}}: nl ww; lang tag; comments' maquillage + comment notes; - ;) |
|||
Line 172: | Line 172: | ||
=={{header|Fortran}}== |
=={{header|Fortran}}== |
||
{{works with|Fortran|90 and later}} |
{{works with|Fortran|90 and later}} |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
! exists and FALSE otherwise |
|||
⚫ | |||
Actually, f90,f95 are able to deal with directory staff: |
|||
logical:: dir_e |
<lang fortran> logical :: dir_e |
||
! a trick to be sure docs is a dir |
|||
inquire( file="./docs/.", exist=dir_e ); |
|||
inquire( file="./docs/.", exist=dir_e ) |
|||
if ( dir_e ) then |
|||
write(*,*), "dir exists!" |
write(*,*), "dir exists!" |
||
else |
else |
||
! workaround: it calls an extern program... |
|||
call system('mkdir docs') |
call system('mkdir docs') |
||
end if |
end if</lang> |
||
=={{header|Haskell}}== |
=={{header|Haskell}}== |