Loading...
You are not logged-in Login/Register





  • Posts   Search Threads
  • ReinaldoJune 6, 2009 8:21 AM PDT   
    Blank space in flie name

    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



    jimdempseyatthecoveJune 6, 2009 9:28 AM PDT
    Rate
     
    Re: Blank space in flie name

    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"'



    Blog: The Parallel Void
    www.quickthreadprogramming.com

    Steve Lionel (Intel)June 6, 2009 1:56 PM PDT
    Rate
     
    Re: Blank space in flie name

    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.


    Steve

    Attaching or including files in a post
    Doctor Fortran blog
    @DoctorFortran on Twitter

    Reinaldo GarciaJuly 2, 2009 6:32 PM PDT
    Rate
     
    Re: Blank space in flie name

    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.

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


    David WhiteJuly 2, 2009 10:07 PM PDT
    Rate
     
    Re: Blank space in flie name

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

Forum jump:  

Intel Software Network Forums Statistics

17,025 users have contributed to 48,321 threads and 172,753 posts to date.

In the past 24 hours, we have 16 new thread(s) 57 new posts(s), and 54 new user(s).

In the past 3 days, the most popular thread for everyone has been How to manage rounding by IVF ?? The most posts were made to Most likely, the issue is that The post with the most views is Optimalization of sine function\'s taylor expansion

Please welcome our newest member redfruit83


For more complete information about compiler optimizations, see our Optimization Notice.