<div dir="auto">Try  "  char instead of  '  (char 39). I never use  '  under Windows. <div dir="auto"><br></div><div dir="auto">Best regards</div><div dir="auto">Sandro Cumerlato </div></div><div class="gmail_extra"><br><div class="gmail_quote">On 22 Mar 2017 23:47, "James Richters" <<a href="mailto:james@productionautomation.net">james@productionautomation.net</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm trying to use copyfile and cannot get it to work,  anyone have any ideas?<br>
<br>
I'm using the procedure below.  My writeln showing the contents of the variables seems to indicate they are correct.  The souce file does exist and is correct, the destination file does not exitst.<br>
I get an error 50 which is<br>
<br>
ERROR_NOT_SUPPORTED  50 (0x32)<br>
    The request is not supported.<br>
<br>
I don't see how copying a file I just created is not supported.  Does anyone have any ideas how to get this to work or what I may be doing wrong, or if there is a better way I should be copying my file?   I've tried using single quotes and double quotes around the file names.<br>
<br>
Thanks<br>
<br>
James<br>
<br>
<br>
Uses<br>
   Serial,Windows,jwanative,<wbr>sysutils;<br>
<br>
Procedure Copy_Backup_Rename(CBR_<wbr>Filename:String);<br>
var<br>
  fileSource, fileDest: string;<br>
  resultsofit : Boolean;<br>
<br>
Begin<br>
   fileSource := chr(39)+Prog_Drive+Prog_Path+'<wbr>\'+CBR_Filename+'.tmp'+chr(39)<wbr>;<br>
   fileDest := chr(39)+'C:'+Prog_Path+'\'+<wbr>CBR_Filename+'.temp'+chr(39);<br>
   writeln (filesource+'    '+filedest);<br>
   resultsofit := CopyFile(PChar(fileSource), PChar(fileDest), False);<br>
   writeln (resultsofit);<br>
   writeln(getlasterror);<br>
End;<br>
<br>
Console output:<br>
'C:\ProMill\BitTool.tmp'    'C:\ProMill\BitTool.temp'<br>
FALSE<br>
50<br>
<br>
______________________________<wbr>_________________<br>
fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.<wbr>org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" rel="noreferrer" target="_blank">http://lists.freepascal.org/<wbr>cgi-bin/mailman/listinfo/fpc-<wbr>pascal</a></blockquote></div></div>