<?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: Rename File() and Copy File() both return 0 in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Rename-File-and-Copy-File-both-return-0/m-p/847989#M102302</link>
    <description>&lt;P&gt;Some functions might give you some more feedback. For example if you try to overwrite data table which is already open&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt &amp;lt;&amp;lt; Save("$TEMP/bigclass_test.jmp");

dt1 = Open("$SAMPLE_DATA/Big Class Families.jmp");

dt1 &amp;lt;&amp;lt; Save("$TEMP/bigclass_test.jmp");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1742020880612.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73892iED12F3E6DB0F2B8B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1742020880612.png" alt="jthi_0-1742020880612.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;and you get this to log&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;This file could not be saved with the given name.

Unable to save file.&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sat, 15 Mar 2025 06:43:27 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2025-03-15T06:43:27Z</dc:date>
    <item>
      <title>Rename File() and Copy File() both return 0</title>
      <link>https://community.jmp.com/t5/Discussions/Rename-File-and-Copy-File-both-return-0/m-p/847921#M102289</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a need to save a small data table as a csv but with an alternate file extension (*.blkl rather than *.csv). The Save As() function doesn't seem to allow for such a provision as near as I can tell so instead of saving the file with my desired filename I save it as *.blkl.csv and then attempt to either directly rename that file to the desired name or perform a copy+delete sequence to get the desired output file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My script will happily save the file but both the Rename File() and Copy File() functions both return 0 indicating that the operation failed with no other information given. How can I go about debugging the failed file operations?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JMP 14.3.0 (64 bit)&lt;BR /&gt;Windows 11 Enterprise (64 bit)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 18:15:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rename-File-and-Copy-File-both-return-0/m-p/847921#M102289</guid>
      <dc:creator>TheSource</dc:creator>
      <dc:date>2025-03-14T18:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Rename File() and Copy File() both return 0</title>
      <link>https://community.jmp.com/t5/Discussions/Rename-File-and-Copy-File-both-return-0/m-p/847932#M102290</link>
      <description>&lt;P&gt;How are you trying to do it? For me this works fine (using JMP18)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");

dt &amp;lt;&amp;lt; Save("$TEMP/bigclass.csv");

Show(File Exists("$TEMP/bigclass.csv"), File Exists("$TEMP/bigclass.blkl"));
Rename File("$TEMP/bigclass.csv", "bigclass.blkl");
Show(File Exists("$TEMP/bigclass.csv"), File Exists("$TEMP/bigclass.blkl"));
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Mar 2025 18:40:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rename-File-and-Copy-File-both-return-0/m-p/847932#M102290</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-03-14T18:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rename File() and Copy File() both return 0</title>
      <link>https://community.jmp.com/t5/Discussions/Rename-File-and-Copy-File-both-return-0/m-p/847934#M102292</link>
      <description>&lt;P&gt;I verified that Jarmo's code works in JMP 14&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 18:47:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rename-File-and-Copy-File-both-return-0/m-p/847934#M102292</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2025-03-14T18:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Rename File() and Copy File() both return 0</title>
      <link>https://community.jmp.com/t5/Discussions/Rename-File-and-Copy-File-both-return-0/m-p/847964#M102298</link>
      <description>&lt;P&gt;I found the issue. Both Rename File() and Copy File() will fail if the file exists so they aren't independently suitable for overwrite operations. I've added a delete-pre-check and it's all running smoothly now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For future reference, do jsl library functions report this sort of debug information anywhere or is it just pass/fail status?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2025 20:52:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rename-File-and-Copy-File-both-return-0/m-p/847964#M102298</guid>
      <dc:creator>TheSource</dc:creator>
      <dc:date>2025-03-14T20:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rename File() and Copy File() both return 0</title>
      <link>https://community.jmp.com/t5/Discussions/Rename-File-and-Copy-File-both-return-0/m-p/847989#M102302</link>
      <description>&lt;P&gt;Some functions might give you some more feedback. For example if you try to overwrite data table which is already open&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1); 

dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt &amp;lt;&amp;lt; Save("$TEMP/bigclass_test.jmp");

dt1 = Open("$SAMPLE_DATA/Big Class Families.jmp");

dt1 &amp;lt;&amp;lt; Save("$TEMP/bigclass_test.jmp");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1742020880612.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/73892iED12F3E6DB0F2B8B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1742020880612.png" alt="jthi_0-1742020880612.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;and you get this to log&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;This file could not be saved with the given name.

Unable to save file.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Mar 2025 06:43:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Rename-File-and-Copy-File-both-return-0/m-p/847989#M102302</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2025-03-15T06:43:27Z</dc:date>
    </item>
  </channel>
</rss>

