×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

gfortran inquire problem

gfortran inquire problem

gfortran inquire problem

(OP)
I have recently acquired a new windows 10 PC, As I did on the old one, I have installed gfortran. My latest project includes an INQUIRE call to check for the existence of a directory whose path name has been supplied by the user, so it could have any length. It could also include spaces.

In the past I have simply used something like:
INQUIRE(FILE=TRIM(folder_name), EXIST=existstatus)

which has worked well, with or without spaces.

Now, however,it works well for path names with no spaces, otherwise the system interprets the path name up to the first space, then backs off and loses the last character before the space.

I'm well acquainted with the idea of surrounding the name with either single or double quotes, but that also fails, with EXIST returned as False.

The problem may be compounded by the existence of a gcc compiler bug related to the TRIM function, which recognises the next character AFTER the last one. Similarly LEN_TRIM returns a value one greater than it should.

I even tried copying the supplied path name into a temporary character string, starting and ending with quotes, but that also failed.

I would greatly appreciate any thoughts anyone may be able to offer.

Alan Turk.

RE: gfortran inquire problem

Which version of gcc/gfortran are you using?

RE: gfortran inquire problem

(OP)
Currently using GNU Fortran (GCC) 11.1.0, which I believe is the latest. The version on my old machine was downloaded several years ago, so was probably an earlier version. Unfortunately the PC died (motherboard problem) and I no longer have it so can't check which version I had. I do, however, have the disks from it installed in my new PC, though not as system disks, so someone may be able to tell me how to access the relevant file(s) to determine the version, assuming that is actually possible.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close