Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

GETFILEINFOQQ

tedpitt
Beginner
720 Views

I wish to use a utility from IFPORT, specifically GETFILEINFOQQ in my program but cannot get it to work. Ive INCLUDED the module, but havent added an additional library. Do I need to do that ?

Ted

0 Kudos
3 Replies
anthonyrichards
New Contributor III
720 Views
Quoting - tedpitt

I wish to use a utility from IFPORT, specifically GETFILEINFOQQ in my program but cannot get it to work. Ive INCLUDED the module, but havent added an additional library. Do I need to do that ?

Ted


Um, you have to USE IFPORT, not INCLUDE it. What exactly is the problem?
0 Kudos
tedpitt
Beginner
720 Views
Quoting - anthonyrichards

Um, you have to USE IFPORT, not INCLUDE it. What exactly is the problem?
Thanks for replying. I meant to say USEd. Herewith code
! PROGRAM: test_file_list
!
! PURPOSE: Tests compatability function GETFILEINFOQQ
!
!****************************************************************************

program test_file_list
!
use ifport
use ifcore
!
implicit none
! Variables
CHARACTER (LEN=120) :: DIRECTORY_PATH='D:WAVE ENERGYEMEC STUDIESEstimation of power from measurements',searchpattern='*.spt',directory
CHARACTER (LEN=140) :: SPECTRAL_PATH='SPECTRAL DATA',SPECTRA_PATH='BUOY B - SPECTRA - mmm 2003',OUTFILE='TESTSW',INFILE
integer(8) :: handle
integer(8) :: length,n=0
logical(4) :: result
type (file$infoi8) info

! Body of test_file_list
DIRECTORY=TRIM (DIRECTORY_PATH)//TRIM (SPECTRAL_PATH)//TRIM (SPECTRA_PATH)
result=changedirqq (directory)
if (result) then
print *, ' Directory change successful'
else
print *, ' Directory change unsuccessful'
pause
endif

I get a 6284 error, and program won't build.

Bit got left out:
length=getstrqq (searchpattern)
handle=file$first
do
length=getfileinfoqq (searchpattern,info,handle)
if (handle==file$last) exit
n=n+1
print *, info%name
enddo
print *, 'Number of files found = ',n
end program test_file_list

0 Kudos
Steven_L_Intel1
Employee
720 Views

The use of INTEGER(8) for HANDLE is correct only on a 64-bit platform. I suggest changing this to:

INTEGER(INT_PTR_KIND())

LENGTH probably wants to be declared this way too.
0 Kudos
Reply