Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6830337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:36:21+00:00 2026-05-26T22:36:21+00:00

I am editing a fortran 90 to read a file. A particular file happens

  • 0

I am editing a fortran 90 to read a file. A particular file happens to be ‘contaminated’ with some extra information, so I wanted to attempt a read and then rewind; reread if in error:

open(filenum,file=filename,form="unformatted",iostat=ierr) //'direct' access
...lots of stuff...
here = ftell(filenum)
read(filenum,iostat=ierr) var1, var2             //try reading as var1, var2
if(iswrong(var1, var2)) then                     //check if correct
  call fseek(filenum,here-ftell(filenum),1)      //rewind
  read(filenum,iostat=ierr) vara, varb, varc     //read as different type 
endif

However, when I compile this program, I get

Undefined symbols:
  "_fseek_", referenced from:
      ___myreader__subroutine_name in myreader.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

(I am trying to compile on gfortran (i686-apple-darwin8-gfortran-4.2)). I understand that fseek is not a standard fortran routine.

I wonder if there is an alternative. I understand I can do something like read(filenum,rec=somevalue) but how can I use this in a similar fashion? I also thought to attempt reading with read(,advance='no') for testing and then reading again with advance='yes' if it is in the correct format, but this requires a specific format expression, which is not specified. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:36:21+00:00Added an answer on May 26, 2026 at 10:36 pm

    You have to use backspace to go back to the previous record. Traditional Fortran IO is record based, non stream based (like in C)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently editing a file, and I'm using irb to test the api:
I editing a latex file into html and I want to change all \\
While editing some records in my PostgreSQL database using sql in the terminal (in
When editing my Rails app, snipMate only seems to load the ruby snippets file
Editing some legacy code that populates a datagrid entirely in code. I need to
While editing an aspx file I found both these opening tags used for seemingly
After editing a column, I wanted to update another column in a datagridview. For
After editing some code I am getting 4 build errors : Undefined symbols for
I was editing a file with vim. I started another vim to edit the
When editing a Perl file, gedit 2.30.3 highlights FIXME , TODO and XXX when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.