parse file with full path does not work

27 views
Skip to first unread message

Denis Bannikov

unread,
Jun 28, 2018, 3:20:51 AM6/28/18
to FoX-discuss
Dear all,
I found the following legacy code

        full_file_path_name = trim(input_dir_name) // "\" // trim( input_file_name )

        call chdir(trim(input_dir_name))

        inquire (file = full_file_path_name, exist = exists)
        if( .not. exists ) then
            is_success = .false.
            essage = "Could not find file: " // trim( full_file_path_name )
            return
        endif

        xml_doc => parseFile(trim(input_file_name), iostat = status)

It works well (status = 0).

But it has function chdir which I do not like. As this is a side effect.

I removed chdir and tried to parseFile with full_file_path_name
        xml_doc => parseFile( trim( full_file_path_name ), iostat = status )
But I got the status = 1001

I tried to pass 
D:\example.xml -> status 1001
D:\\Case_20_basic.xml  -> status 1001
D:/example.xml -> status = 1
"D:\example.xml"  -> status 1001

but I failed to find working variant.

Is there a way to open the file with full path?

Andrew Walker [EAR]

unread,
Jun 28, 2018, 1:22:21 PM6/28/18
to fox-d...@googlegroups.com
Hi Denis,

Take a look at the end of the thread at: https://groups.google.com/forum/#!topic/fox-discuss/n3I9ISgDGek – full paths, windows fortran compilers and XML have been a rather long running issue but I think we got this fixed. It's also probably worth checking that you have an up to date version from github. The releases are well out of date.

Best wishes,

Andrew




--
You received this message because you are subscribed to the Google Groups "FoX-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fox-discuss...@googlegroups.com.
To post to this group, send email to fox-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/fox-discuss.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages