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

IFPOSIX

Eldhuset__Knut
Beginner
285 Views

I have start problems with IFPOSIX calls. In the small program below I
have set iopenflag=0 and imode=0.

How do Iset these parameters. Ihave indicated whatI want to do in the commented lines
iopenflag=IPXFCONST(O_RDONLY) ????.

If I try the program below I get ierror_2=22 and nread=183

Hope you can complete the program

Regards Knut Eldhuset



PROGRAM read_posix

USE IFPOSIX

character*200 path

integer*2 buf(2000)

character buf2(4000)

equivalence (buf,buf2)

path="C:\KE_FILES\Radarsat 2\Flevoland_DK405_FQ9_20080402_171638_H

+H_VV_HV_VH_SLC\imagery_vv_magn"

ilen_pathn=90

! iopenflag=IPXFCONST(O_RDONLY) ????

! imode=IPXFCONST(O_BINARY) ????

iopenflag=0

imode=0

call pxfopen(path,ilen_pathn, iopenflag , imode,ifildes,

+ierror_1)

write(*,*)'ierror_1:',ierror_1

ioffset=0

iwhence=0

call pxffseek(ifildes,ioffset,iwhence,ierror_2)

nbytes=2000

write(*,*)'ierror_2:',ierror_2

call pxfread(ifildes,buf2,nbytes,nread,ierror_3)

write(*,*)'ierror_3,nread',ierror_3,nread

write(*,*)buf(16:18),buf(147:148)

end

0 Kudos
1 Reply
TimP
Honored Contributor III
285 Views
Path names with spaces are tricky. You would likely need quote marks inside the string-defining quote marks which don't go into the compiled string. Try at least to set up the string so it works on command line, e.g. with DIR. Avoid taking chances with line continuation in mid string. You could define 2 constant strings and concatenate them in Fortran by //.
0 Kudos
Reply