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.
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.