<?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 Win32 API CopyFile does not work in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Win32-API-CopyFile-does-not-work/m-p/809168#M41817</link>
    <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I'm developing a workaround for a colleague that needs to perform a lot of copy statements. "Call System("copy..")" does not work in this case. Therefore I tried to call the win32 API CopyFile using the kernel32 module. It gives the following errormessage:&lt;BR /&gt;&lt;BR /&gt;Error: The same named entity from different modules and/or program units cannot be referenced. [COPYFILE]&lt;BR /&gt;&lt;BR /&gt;The win32 API MoveFile workes fine though. I use compiler 10.1.029.&lt;BR /&gt;&lt;BR /&gt;Here's the samplecode:&lt;BR /&gt;&lt;PRE&gt;[fortran]Program CopyFile

Use Kernel32

Implicit None

Integer(BOOL)      :: retval,NotOverWrite
Character(Len=200) :: lpExistingFileName,lpNewFileName
 
  NotOverwrite = 0

  lpExistingFileName = "D:\TestFile.txt"
  lpNewFileName = "D:\TestFile_copy.txt"

  retval = CopyFile(Trim(lpExistingFileName)//""C,Trim(lpNewFileName)//""C,FALSE)
  retval = MoveFile(lpExistingFileName,lpNewFileName)

End Program CopyFile
[/fortran]&lt;/PRE&gt; Thanks in advance for any useful answers!&lt;BR /&gt;&lt;BR /&gt;Cheers, Arjen&lt;BR /&gt;</description>
    <pubDate>Thu, 03 Feb 2011 08:22:19 GMT</pubDate>
    <dc:creator>sjors</dc:creator>
    <dc:date>2011-02-03T08:22:19Z</dc:date>
    <item>
      <title>Win32 API CopyFile does not work</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Win32-API-CopyFile-does-not-work/m-p/809168#M41817</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I'm developing a workaround for a colleague that needs to perform a lot of copy statements. "Call System("copy..")" does not work in this case. Therefore I tried to call the win32 API CopyFile using the kernel32 module. It gives the following errormessage:&lt;BR /&gt;&lt;BR /&gt;Error: The same named entity from different modules and/or program units cannot be referenced. [COPYFILE]&lt;BR /&gt;&lt;BR /&gt;The win32 API MoveFile workes fine though. I use compiler 10.1.029.&lt;BR /&gt;&lt;BR /&gt;Here's the samplecode:&lt;BR /&gt;&lt;PRE&gt;[fortran]Program CopyFile

Use Kernel32

Implicit None

Integer(BOOL)      :: retval,NotOverWrite
Character(Len=200) :: lpExistingFileName,lpNewFileName
 
  NotOverwrite = 0

  lpExistingFileName = "D:\TestFile.txt"
  lpNewFileName = "D:\TestFile_copy.txt"

  retval = CopyFile(Trim(lpExistingFileName)//""C,Trim(lpNewFileName)//""C,FALSE)
  retval = MoveFile(lpExistingFileName,lpNewFileName)

End Program CopyFile
[/fortran]&lt;/PRE&gt; Thanks in advance for any useful answers!&lt;BR /&gt;&lt;BR /&gt;Cheers, Arjen&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Feb 2011 08:22:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Win32-API-CopyFile-does-not-work/m-p/809168#M41817</guid>
      <dc:creator>sjors</dc:creator>
      <dc:date>2011-02-03T08:22:19Z</dc:date>
    </item>
    <item>
      <title>Win32 API CopyFile does not work</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Win32-API-CopyFile-does-not-work/m-p/809169#M41818</link>
      <description>Hello&lt;BR /&gt;&lt;BR /&gt;Your program is named CopyFile so it interfers with the function name.&lt;BR /&gt;&lt;BR /&gt;Change "program CopyFile" to "program Copy_File" and it will work.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 03 Feb 2011 09:14:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Win32-API-CopyFile-does-not-work/m-p/809169#M41818</guid>
      <dc:creator>GVautier</dc:creator>
      <dc:date>2011-02-03T09:14:13Z</dc:date>
    </item>
    <item>
      <title>Win32 API CopyFile does not work</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Win32-API-CopyFile-does-not-work/m-p/809170#M41819</link>
      <description>Auch, that indeed solves the problem. I thought Fortran was more tolerant in the name of the Program itself. Sorry to have bothered you with this, but thanks for the help anyway!&lt;BR /&gt;&lt;BR /&gt;Cheers Arjen</description>
      <pubDate>Mon, 07 Feb 2011 10:34:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Win32-API-CopyFile-does-not-work/m-p/809170#M41819</guid>
      <dc:creator>sjors</dc:creator>
      <dc:date>2011-02-07T10:34:15Z</dc:date>
    </item>
    <item>
      <title>Win32 API CopyFile does not work</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Win32-API-CopyFile-does-not-work/m-p/809171#M41820</link>
      <description>In a Fortran program, no two entities in the "global" class may have the same name. These are: program units (main program, subroutines, functions, block data subprograms, modules), common blocks and external procedures.</description>
      <pubDate>Mon, 07 Feb 2011 15:49:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Win32-API-CopyFile-does-not-work/m-p/809171#M41820</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2011-02-07T15:49:57Z</dc:date>
    </item>
  </channel>
</rss>

