- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Run this is a directory with a file named crp.rpt-12 and the extension will be incorrect. It should show .rpt. It shows .rpt-12. RHEL 5.5, intel64, Compiler version 11.0.072 or 12.0.1.107, no compiler arguments.
program splitbug
USE IFPORT
CHARACTER($MAXPATH) buf
CHARACTER(3) drive
CHARACTER(256) dir
CHARACTER(256) name
CHARACTER(256) ext
CHARACTER(256) file
INTEGER(4) length
file = 'crp.rpt'
length = SPLITPATHQQ(file, drive, dir, name, ext)
WRITE(*,*) drive, dir, name, ext
END
program splitbug
USE IFPORT
CHARACTER($MAXPATH) buf
CHARACTER(3) drive
CHARACTER(256) dir
CHARACTER(256) name
CHARACTER(256) ext
CHARACTER(256) file
INTEGER(4) length
file = 'crp.rpt'
length = SPLITPATHQQ(file, drive, dir, name, ext)
WRITE(*,*) drive, dir, name, ext
END
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm unable to reproduce the incorrect extension with either 12.1.107 or 11.1.072. The output is the same with each compiler and includes the correct .rpt extension when the crp.rpt-12 file is present or not.
$ ifort -V u79707.f90
Intel Fortran Intel 64 Compiler XE for applications running on Intel 64, Version 12.0.1.107 Build 20101116
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.
Intel Fortran 12.0-1230
GNU ld version 2.17.50.0.6-5.el5 20061020
$ rm crp.rpt-12
$./a.out
/tmp/u79707/
crp
.rpt
$touch crp.rpt-12
$./a.out
/tmp/u79707/
crp
.rpt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SPLITPATHQQ is just a string parsing subroutine. We may interpret the arguments as representing a path and the pieces that make up the path string, but SPLITPATHQQ is a pure subroutine which splits the input argument into its component parts. Try using 'XY::@$**/??@#%^&' instead of 'crp.rpt'; the routine still does its job.
There should be no connection between the results and the existence or non-existence of any files. Secondly, the 'drive' argument is inappropriate for Linux/Unix, so we find an empty string returned for 'drive'. It seems to me that this part of the result is produced by the parsing rules that are built into the subroutine and not by doing system calls related to the filesystem. Extrapolating, I claim that if we had a Fortran compiler on CP/M with SPLITPATHQQ in the RTL the results would still be the same -- even though on this OS there was no file tree structure.
There should be no connection between the results and the existence or non-existence of any files. Secondly, the 'drive' argument is inappropriate for Linux/Unix, so we find an empty string returned for 'drive'. It seems to me that this part of the result is produced by the parsing rules that are built into the subroutine and not by doing system calls related to the filesystem. Extrapolating, I claim that if we had a Fortran compiler on CP/M with SPLITPATHQQ in the RTL the results would still be the same -- even though on this OS there was no file tree structure.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page