- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Lien copié
5 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
[bash]! TYPE T_WIN32_FIND_DATA ! SEQUENCE ! integer(DWORD) dwFileAttributes ! knowns DWORD ! TYPE (T_FILETIME) ftCreationTime ! typedefs FILETIME ! TYPE (T_FILETIME) ftLastAccessTime ! typedefs FILETIME ! TYPE (T_FILETIME) ftLastWriteTime ! typedefs FILETIME ! integer(DWORD) nFileSizeHigh ! knowns DWORD ! integer(DWORD) nFileSizeLow ! knowns DWORD ! integer(DWORD) dwReserved0 ! knowns DWORD ! integer(DWORD) dwReserved1 ! knowns DWORD ! character(260) cFileName ! character(14) cAlternateFileName ! END TYPE RECURSIVE FUNCTION file_exists (fname) RESULT (size) IMPLICIT NONE TYPE(T_WIN32_FIND_DATA) :: fdata CHARACTER(LEN=*),INTENT(IN) :: fname ! full pathname, null-terminated INTEGER(HANDLE) :: ihandl INTEGER :: size, rval size = -1 ihandl = FindFirstFile (fname, fdata) IF (ihandl /= INVALID_HANDLE_VALUE) THEN ! retrieve file data components size = fdata%nFileSizeLow ! clean up rval = FindClose (ihandl) ENDIF END FUNCTION file_exists[/bash]
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
John,
I can't see the problem you describe. Example, please.
C:\Projects>notepad thisisaverylongfilenamewhoselengthislongerthan34chars.test
C:\Projects>ifort getfileinfoqq.f90
Intel Visual Fortran Compiler Professional for applications running on IA-32,
Version 11.1 Build 20100414 Package ID: w_cprof_p_11.1.065
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.
Microsoft Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
-out:getfileinfoqq.exe
-subsystem:console
getfileinfoqq.obj
C:\Projects>getfileinfoqq.exe
thisisaverylongfilenamewhoselengthislongerthan34chars.test
I can't see the problem you describe. Example, please.
[fxfortran]use ifport type (FILE$INFO) :: info integer(int_ptr_kind()) :: handle handle = FILE$FIRST iret = GETFILEINFOQQ('*.test', info, handle) print *, trim(info%name) end[/fxfortran]
C:\Projects>notepad thisisaverylongfilenamewhoselengthislongerthan34chars.test
C:\Projects>ifort getfileinfoqq.f90
Intel Visual Fortran Compiler Professional for applications running on IA-32,
Version 11.1 Build 20100414 Package ID: w_cprof_p_11.1.065
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.
Microsoft Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
-out:getfileinfoqq.exe
-subsystem:console
getfileinfoqq.obj
C:\Projects>getfileinfoqq.exe
thisisaverylongfilenamewhoselengthislongerthan34chars.test
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Steve,
After a good night's sleep,(something that had been lacking for a few days)the problem became apparent as an erroron my part. The returned file length was not being updated after the first call to getfileinfoqq... Sorry for the bother. Any chance the next version of ifort will allow branches into if blocks?
John
After a good night's sleep,(something that had been lacking for a few days)the problem became apparent as an erroron my part. The returned file length was not being updated after the first call to getfileinfoqq... Sorry for the bother. Any chance the next version of ifort will allow branches into if blocks?
John
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Um, no. Not a chance at all. Why would you even ask for such a thing?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
John David,
I understand Steve Lionel's answer to your question. Transferring control into a block from outside it is strictly prohibited by the Fortran Standard, and has been since blocks were first introduced in FORTRAN 77. This prohibition applies to all blocks, not just IF blocks.
Section 8.1.1 of the Fortran 2003 Standard contains rules governing blocks. Section 8.1.1.2, "Control flow in blocks", says:
[Begin quote]
Transfer of control to the interior of a block from outside the block is prohibited. Transfers within a block and transfers from the interior of a block to outside the block may occur.
Subroutine and function references (12.4.2, 12.4.3) may appear in a block.
[End of quote]
I understand Steve Lionel's answer to your question. Transferring control into a block from outside it is strictly prohibited by the Fortran Standard, and has been since blocks were first introduced in FORTRAN 77. This prohibition applies to all blocks, not just IF blocks.
Section 8.1.1 of the Fortran 2003 Standard contains rules governing blocks. Section 8.1.1.2, "Control flow in blocks", says:
[Begin quote]
Transfer of control to the interior of a block from outside the block is prohibited. Transfers within a block and transfers from the interior of a block to outside the block may occur.
Subroutine and function references (12.4.2, 12.4.3) may appear in a block.
[End of quote]

Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable