- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I Open a file that has a path with blank spaces, e.g C:\Program files\etc...) the file is not found because it is truncated to C:\Program
Is there a way to have fortran get the full path and name with blank spaces?
Thanks,
Reinaldo
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Reinaldo
When I Open a file that has a path with blank spaces, e.g C:Program filesetc...) the file is not found because it is truncated to C:Program
Is there a way to have fortran get the full path and name with blank spaces?
Thanks,
Reinaldo
Enquote the quotes (you have both ' and " for quotes)
'"C:Program Files"'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How is this filename getting to Fortran? Is it a command line argument? You'll see the same behavior for many applications. Enclosing the filename in quotes ("") will handle that.
If it's just in an OPEN, then embedded blanks in a file specification are fine.
If it's just in an OPEN, then embedded blanks in a file specification are fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Steve Lionel (Intel)
How is this filename getting to Fortran? Is it a command line argument? You'll see the same behavior for many applications. Enclosing the filename in quotes ("") will handle that.
If it's just in an OPEN, then embedded blanks in a file specification are fine.
If it's just in an OPEN, then embedded blanks in a file specification are fine.
Thanks Steve:
I use the GETARG subroutine to assign from the command line argument the file name to a character variable. The file name may have blank spaces. I then use the fullpathqq and splitpathqq functions to extract the path, which I assign to anothervariable. In both cases I get the names trucated when there is a blank space. What can I do in those cases?
Thanks so much,
Reinaldo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Reinaldo Garcia
Thanks Steve:
I use the GETARG subroutine to assign from the command line argument the file name to a character variable. The file name may have blank spaces. I then use the fullpathqq and splitpathqq functions to extract the path, which I assign to anothervariable. In both cases I get the names trucated when there is a blank space. What can I do in those cases?
Thanks so much,
Reinaldo
I would expect that you need to surround the argument in the command line with double quotes. As mentioned earlier, this behavious is common with other Windows programs.
David
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