<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GetFullPathName in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819335#M46844</link>
    <description>You want:&lt;BR /&gt;&lt;BR /&gt;filename='WideString.exe'&lt;FONT color="#ff0000"&gt;C&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;You also need to either search for the trailing NUL in the return value or use the function return value for the length.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;</description>
    <pubDate>Sat, 13 Jan 2007 05:49:42 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2007-01-13T05:49:42Z</dc:date>
    <item>
      <title>GetFullPathName</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819334#M46843</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am trying to get a full path where the executable is located at run-time. So here's what I'm trying:&lt;/P&gt;
&lt;P&gt; program main&lt;BR /&gt; use KERNEL32&lt;/P&gt;
&lt;P&gt; CHARACTER*500 path&lt;BR /&gt; integer(LPSTR) path1&lt;BR /&gt; CHARACTER*200 filename&lt;BR /&gt; integer(DWORD) dum&lt;BR /&gt; path1=0&lt;BR /&gt; filename='WideString.exe'&lt;BR /&gt; dum = GetFullPathName(filename, 500, path, path1)&lt;/P&gt;
&lt;P&gt; if(dum .eq. 0)then&lt;BR /&gt; dum=GetLastError()&lt;BR /&gt; print *, dum&lt;BR /&gt; endif &lt;/P&gt;
&lt;P&gt; print *, path&lt;/P&gt;
&lt;P&gt; end&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;'WideString.exe' is the name of the executable. Similar code works well in C++, but not in Fortran. &lt;/P&gt;
&lt;P&gt;Any idea what I'm doing wrong or a better way to accomplish this?&lt;/P&gt;
&lt;P&gt;I forgot the mention...GetFullPathName and GetLastError both return 0, and the variable path ends up being a blank string.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2007 05:40:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819334#M46843</guid>
      <dc:creator>Nick2</dc:creator>
      <dc:date>2007-01-13T05:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: GetFullPathName</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819335#M46844</link>
      <description>You want:&lt;BR /&gt;&lt;BR /&gt;filename='WideString.exe'&lt;FONT color="#ff0000"&gt;C&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;You also need to either search for the trailing NUL in the return value or use the function return value for the length.&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;</description>
      <pubDate>Sat, 13 Jan 2007 05:49:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819335#M46844</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2007-01-13T05:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: GetFullPathName</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819336#M46845</link>
      <description>&lt;P&gt;Ah, thank you!&lt;/P&gt;
&lt;P&gt;Only GetFullPathName returned the current path, rather than executable's path. Any better functions to accomplish this?&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2007 07:11:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819336#M46845</guid>
      <dc:creator>Nick2</dc:creator>
      <dc:date>2007-01-13T07:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: GetFullPathName</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819337#M46846</link>
      <description>&lt;P&gt;&lt;FONT size="1"&gt;The routine you want is&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1"&gt;INTEGER :: nc&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1"&gt;CHARACTER(LEN=255) :: fpname&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1"&gt;nc = &lt;STRONG&gt;&lt;FONT color="#000000"&gt;GetModuleFileName&lt;/FONT&gt;&lt;/STRONG&gt;(GetModuleHandle('MYPROG.EXE'C), fpname, &lt;FONT color="#0000ff"&gt;LEN&lt;/FONT&gt;(fpname))&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1"&gt;where you supply the name of your running executable and fpname is returned with the full UNC path.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jan 2007 07:21:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819337#M46846</guid>
      <dc:creator>Paul_Curtis</dc:creator>
      <dc:date>2007-01-13T07:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: GetFullPathName</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819338#M46847</link>
      <description>Even better, pass NULL to GetModuleHandle to get the handle to the running EXE, whatever its name is.</description>
      <pubDate>Sat, 13 Jan 2007 08:15:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819338#M46847</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2007-01-13T08:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: GetFullPathName</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819339#M46848</link>
      <description>Awesome! I love it how the function returns the number of characters in the path too!</description>
      <pubDate>Sat, 13 Jan 2007 08:51:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/GetFullPathName/m-p/819339#M46848</guid>
      <dc:creator>Nick2</dc:creator>
      <dc:date>2007-01-13T08:51:43Z</dc:date>
    </item>
  </channel>
</rss>

