- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would the following be a way to read all the bytes from a file into an array of integer*1 where isz is determined by FSTAT?(older version without 'stream')
isz = -1
open(iFN,file=sfilef,action='read',IOSTAT=iiostat,FORM='BINARY',ACCESS='SEQUENTIAL')
ISTAT = FSTAT (iFN, statarray)
if (.NOT. istat) then
print *, statarray
isz = statarray(8)
end if
if (isz > 0) then
ALLOCATE(ab(1:isz))
open(iFN,file=sfilef,action='read',IOSTAT=iiostat,FORM='BINARY',ACCESS='SEQUENTIAL')
read(iFN) ab
close (iFN)
ireturn = isz
else
close (iFN)
ireturn = -1
endif
f2a = ireturn
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page