<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Thanks for the response, it got me on the right track and I got it working.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>I originally did try “ instead of ‘ and have the same results. I was using ‘ because of the example here: <a href="http://wiki.freepascal.org/CopyFile">http://wiki.freepascal.org/CopyFile</a> <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>I was able to get it to work without any ‘ or “ I even did a test with a space in the file name and it worked fine without “ <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>It appears The function must put “ around it for you.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>James<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> fpc-pascal [mailto:fpc-pascal-bounces@lists.freepascal.org] <b>On Behalf Of </b>Sandro Cumerlato<br><b>Sent:</b> Thursday, March 23, 2017 1:30 AM<br><b>To:</b> FPC-Pascal users discussions <fpc-pascal@lists.freepascal.org><br><b>Subject:</b> Re: [fpc-pascal] FreePascal Windows - Force files to write to disk<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Try " char instead of ' (char 39). I never use ' under Windows. <o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Best regards<o:p></o:p></p></div><div><p class=MsoNormal>Sandro Cumerlato <o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On 22 Mar 2017 23:47, "James Richters" <<a href="mailto:james@productionautomation.net">james@productionautomation.net</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><p class=MsoNormal>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,sysutils;<br><br>Procedure Copy_Backup_Rename(CBR_Filename:String);<br>var<br> fileSource, fileDest: string;<br> resultsofit : Boolean;<br><br>Begin<br> fileSource := chr(39)+Prog_Drive+Prog_Path+'\'+CBR_Filename+'.tmp'+chr(39);<br> fileDest := chr(39)+'C:'+Prog_Path+'\'+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>_______________________________________________<br>fpc-pascal maillist - <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br><a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a><o:p></o:p></p></blockquote></div></div></div></body></html>