#227 EOF always returns 0...?

open
nobody
None
5
2009-11-11
2009-11-11
Anonymous
No

GDL>
$echo blabla > testfile.txt
line=''
openr,gfile,'testfile.txt',/get_lun
readf, gfile, line
PRINT, EOF(gfile)
;; GDL returns 0, while IDL returns the correct value, 1.

Discussion

  • Sylwester Arabas

    Hello,

    I've tried the code on the current CVS version on Linux and OSX, and in both cases the result was consistent with IDL:

    GDL> $echo blabla > testfile.txt
    GDL> line=''
    GDL> openr,gfile,'testfile.txt',/get_lun
    GDL> readf, gfile, line
    GDL> PRINT, EOF(gfile)
    1

    If possible, please provide some more details concerning your platform and GDL version.

    Regards,
    Sylwester

     
  • Nobody/Anonymous

    Hi,
    I've just installed the CVS version (previously, I was using the 0.9rc3 version): same problem.

    'uname -a' yields:
    Linux head 2.4.20-46.7.legacysmp #1 SMP Sat Mar 4 14:58:59 EST 2006 i686 unknown

    Thanks for looking into this. It is rather a showstopper...
    Regards,
    --Pascal

     
  • Marc Schellens

    Marc Schellens - 2009-11-15

    I cannot reproduce the problem either. Please check the latest CVS. I committed yesterday a big patch to the file IO system. Although the logic for EOF is practically unchanged and an old version works fine as well for me.
    uname -a
    Linux host 2.6.24-25-generic #1 SMP Tue Oct 20 07:31:10 UTC 2009 i686 GNU/Linux
    Is your c++ stream library up to date?

     
  • Nobody/Anonymous

    I was using gcc 3.2.3. It's the newest version of g++ that the current OS will support, and I don't think any of the libraries (stream or otherwise) have been recently updated (the machine's the head node of an old Beowulf cluster, and I don't have root access). EOF indeed works fine on another machine, with newer OS and g++ v3.4.6.

     
  • Marc Schellens

    Marc Schellens - 2009-11-19

    In this case it looks that it is the compiler/library.
    GDL does on the stream
    clear()
    peek()
    then returns eof()
    I believe this is correct

     
  • Marc Schellens

    Marc Schellens - 2009-11-19

    Can you provoke EOF() returning 1 at all?

     
  • Nobody/Anonymous

    I have not managed to make EOF() return anything but a 0 (on that particular machine).

     
  • Marc Schellens

    Marc Schellens - 2009-11-21

    What if you create the file without newline?
    echo -n blabla > testfile.txt
    ^

     
  • Nobody/Anonymous

    No more luck...

    GDL>
    $echo -n blabla > testfile.txt
    OPENR, gfile, 'testfile.txt',/GET_LUN
    a=''
    READF,gfile, a
    PRINT, EOF(gfile)
    0

    FYI, I am using the CVS version as of ~two weeks ago. I've had problems installing the newest one.
    It seems that, now, the install script absolutely wants to look for the libgsl.so in /usr/lib, even though I tell 'configure' to look elsewhere (via "--with-gsldir=..."). This is an issue I've never had so far with previous CVS and rc3 versions.

     
  • Nobody/Anonymous

    Ok. Finally managed to install latest CVS version, but needed 2 hacks to do so:
    1) setenv LDFLAGS -L/path/to/my/gsl/lib
    before running 'configure'. I think that this very recent issue must be in one of the configuration scripts, and should be easily corrected by you.
    2) Despite the above hack, during 'make', I get an error message concerning the basic_op.cpp file. To bypass that issue (temporarily at least), I replaced it with a previous version (CVS from 2009/11/13), and finally managed to compile GDL.

    ...but same problem with EOF()... I'm beginning to think there is little hope for GDL running properly on that Beowulf cluster, unless major OS and software upgrades are done beforehand.

    --Pascal

     
  • Sylwester Arabas

    Hi,

    Concerning the compilation issues with the current CVS version, please try --with-openmp=no

    Cheers,
    Sylwester

     
  • Nobody/Anonymous

    Hi Sylwester,
    Sadly, that did not help...
    --Pascal

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks