- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to load a file larger than the 2GB limit.
The format of the file I am reading is binary with an integer occupying the first position to tell me how many eigenvectors are contained in the file.
My test program ( see attached ) works fine for files less than 2GB, However if I try and read a file over 2GB, then it inexplicably fails with IO Error 154.
looking at the strace of the program I can see that the O_LARGEFILE bit is set and that it is reading the information in correctly ( I can tell by the read to the first file which contains a summation of info with the number of entries also contaiend in the first position of the file.)
Ok, strace of failing run is: (relevant data )
open("PCGS1319.EVL", O_RDWR|O_LARGEFILE) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE, 0xbfffd740) = -1 ENOTTY (Inappropriate ioctl for device)
write(1, " OPENED EVL ", 12) = 12
read(3, "215"..., 4096) = 1132
write(1, " NMODE = 141 ", 22) = 22
close(3) = 0
stat64("PCGS1319.EVC", {st_mode=S_IFREG|0600, st_size=2619750676, ...}) = 0
stat64("PCGS1319.EVC", {st_mode=S_IFREG|0600, st_size=2619750676, ...}) = 0
open("PCGS1319.EVC", O_RDWR|O_LARGEFILE) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE, 0xbfffd750) = -1 ENOTTY (Inappropriate ioctl for device)
write(1, " OPENED EVC ", 12) = 12
read(3, "21520230(217 265366?"..., 4096) = 4096
write(1, " ERROR: IOSTAT = 154 ", 30) = 30
close(3) = 0
hmmm - read data in fine ! and works for files < GB.
any ideas ???
P.S. it's not letting me attach files, so I've placed a copy here:
PROGRAM TEST
IMPLICIT NONE
C
INTEGER IOSTATUS, NMODE
C
CHARACTER FILENAME*80, TMPFILE*80
C
C FILENAME = 'PCGS8351'
FILENAME = 'PCGS1319'
PRINT *,'FILE = ', FILENAME(1:8)
C OPEN EVL FILE. contain summation of data
C
TMPFILE = FILENAME(1:8)//'.EVL'
OPEN (UNIT=96, IOSTAT=IOSTATUS, ERR=123, FILE=TMPFILE,
1 STATUS='UNKNOWN', ACCESS='SEQUENTIAL', FORM='BINARY')
PRINT *,'OPENED EVL'
C
C READ NUMBER OF MODES.
C
READ (96, IOSTAT=IOSTATUS, ERR=123) NMODE
PRINT *,'NMODE = ', NMODE
CLOSE(96)
C
C OPEN EVC FILE. contains eigenvectors
C
TMPFILE = FILENAME(1:8)//'.EVC'
OPEN (UNIT=95, IOSTAT=IOSTATUS, ERR=123, FILE=TMPFILE,
1 STATUS='UNKNOWN', ACCESS='SEQUENTIAL', FORM='BINARY')
PRINT *,"OPENED EVC"
C
C READ NUMBER OF MODES.
C
READ (95, IOSTAT=IOSTATUS, ERR=123) NMODE
PRINT *,'NMODE = ', NMODE
CLOSE(95)
STOP
123 PRINT *,'ERROR: IOSTAT = ',IOSTATUS
STOP
END
The format of the file I am reading is binary with an integer occupying the first position to tell me how many eigenvectors are contained in the file.
My test program ( see attached ) works fine for files less than 2GB, However if I try and read a file over 2GB, then it inexplicably fails with IO Error 154.
looking at the strace of the program I can see that the O_LARGEFILE bit is set and that it is reading the information in correctly ( I can tell by the read to the first file which contains a summation of info with the number of entries also contaiend in the first position of the file.)
Ok, strace of failing run is: (relevant data )
open("PCGS1319.EVL", O_RDWR|O_LARGEFILE) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE, 0xbfffd740) = -1 ENOTTY (Inappropriate ioctl for device)
write(1, " OPENED EVL ", 12) = 12
read(3, "215"..., 4096) = 1132
write(1, " NMODE = 141 ", 22) = 22
close(3) = 0
stat64("PCGS1319.EVC", {st_mode=S_IFREG|0600, st_size=2619750676, ...}) = 0
stat64("PCGS1319.EVC", {st_mode=S_IFREG|0600, st_size=2619750676, ...}) = 0
open("PCGS1319.EVC", O_RDWR|O_LARGEFILE) = 3
ioctl(3, SNDCTL_TMR_TIMEBASE, 0xbfffd750) = -1 ENOTTY (Inappropriate ioctl for device)
write(1, " OPENED EVC ", 12) = 12
read(3, "21520230(217 265366?"..., 4096) = 4096
write(1, " ERROR: IOSTAT = 154 ", 30) = 30
close(3) = 0
hmmm - read data in fine ! and works for files < GB.
any ideas ???
P.S. it's not letting me attach files, so I've placed a copy here:
PROGRAM TEST
IMPLICIT NONE
C
INTEGER IOSTATUS, NMODE
C
CHARACTER FILENAME*80, TMPFILE*80
C
C FILENAME = 'PCGS8351'
FILENAME = 'PCGS1319'
PRINT *,'FILE = ', FILENAME(1:8)
C OPEN EVL FILE. contain summation of data
C
TMPFILE = FILENAME(1:8)//'.EVL'
OPEN (UNIT=96, IOSTAT=IOSTATUS, ERR=123, FILE=TMPFILE,
1 STATUS='UNKNOWN', ACCESS='SEQUENTIAL', FORM='BINARY')
PRINT *,'OPENED EVL'
C
C READ NUMBER OF MODES.
C
READ (96, IOSTAT=IOSTATUS, ERR=123) NMODE
PRINT *,'NMODE = ', NMODE
CLOSE(96)
C
C OPEN EVC FILE. contains eigenvectors
C
TMPFILE = FILENAME(1:8)//'.EVC'
OPEN (UNIT=95, IOSTAT=IOSTATUS, ERR=123, FILE=TMPFILE,
1 STATUS='UNKNOWN', ACCESS='SEQUENTIAL', FORM='BINARY')
PRINT *,"OPENED EVC"
C
C READ NUMBER OF MODES.
C
READ (95, IOSTAT=IOSTATUS, ERR=123) NMODE
PRINT *,'NMODE = ', NMODE
CLOSE(95)
STOP
123 PRINT *,'ERROR: IOSTAT = ',IOSTATUS
STOP
END
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