<?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: How to enforce JMP to open a file in read only mode? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275300#M53424</link>
    <description>&lt;P&gt;&lt;LI-MESSAGE title="Saving to disk as hidden or read-only" uid="254865" url="https://community.jmp.com/t5/Discussions/Saving-to-disk-as-hidden-or-read-only/m-p/254865#U254865" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;has a RunProgram snippet to run the DOS attrib command. You can mark the file as read-only, or clear the flag.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jun 2020 22:44:17 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2020-06-24T22:44:17Z</dc:date>
    <item>
      <title>How to enforce JMP to open a file in read only mode?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/274587#M53263</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;I use a method to update Addins like described in&amp;nbsp;&lt;A href="https://community.jmp.com/t5/JMP-Scripts/How-to-write-self-updating-JMP-add-ins/ta-p/21932/jump-to/first-unread-message" target="_self"&gt;https://community.jmp.com/t5/JMP-Scripts/How-to-write-self-updating-JMP-add-ins/ta-p/21932/jump-to/first-unread-message&lt;/A&gt;&amp;nbsp; by &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6878"&gt;@Jeff_Perkinson&lt;/a&gt;&amp;nbsp;. There a file "metadata.jmp" Needs to be opened when JMP starts. I experienced some Problems with Opening this file automatically by many users, because under some circumstances a user might Keep that file opened for a Long time (without knowing this), and then I'm not able to update this files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also in other cases (large datatables shared by many users) it May be good to open files in Read only mode.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a possibility to enforce JMP to open a data table etc. in Read only mode?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:29:48 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/274587#M53263</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2023-06-09T23:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to enforce JMP to open a file in read only mode?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/274833#M53311</link>
      <description>&lt;P&gt;I'm not sure how to open a file as read only (if anyone knows please chime in), but here are some ideas that might help you alleviate your issue:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Change file permissions so most users have read-only access to that file.&lt;/LI&gt;&lt;LI&gt;Make the section of code that needs the file open short and simple, and wrap it in a try block.&amp;nbsp; After the try block that handle the file operations, or in the catchExpr section, include code to close the file.&amp;nbsp; For example:&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;try(
	//Work with the file here
	dt = Open("a file");
	values = dt:Column &amp;lt;&amp;lt; get values;
	dt &amp;lt;&amp;lt; Close;
	
,	//This is the catchExpr, it is executed on an error.
	
	//Make sure the file is closed, but don't throw another if it wasn't open.
	try( dt &amp;lt;&amp;lt; Close ); 
	
	//Now raise an error.
	throw( "Error working with metadata file: " || char( Exception_msg ) );
);


//Or you could close the file in a subsequent try function
try(
	//Work with the file here
	dt = Open("a file");
	values = dt:Column &amp;lt;&amp;lt; get values;
);
try( dt &amp;lt;&amp;lt; Close ); 


//Now do any time consuming functions on the data extracted from that file
//show(values);&lt;/CODE&gt;&lt;/PRE&gt;&amp;nbsp;&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 23 Jun 2020 00:57:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/274833#M53311</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2020-06-23T00:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to enforce JMP to open a file in read only mode?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/274951#M53346</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6657"&gt;@ih&lt;/a&gt;&amp;nbsp;&amp;nbsp;thanks for your ideas, I will try to find a good working solution with it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Setting permissions in filesystem is a straight Forward solution I would prefer, but Looking at it in Detail (files are on fileserver), I found many users to set the Rights for, and so it turned out to be complex. Because we have a few hundred users using the files, and I do not know under which users they act.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just I&amp;nbsp;got another idea:&lt;/P&gt;&lt;P&gt;- to copy the file to $TEMP and then open it&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 11:37:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/274951#M53346</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2020-06-23T11:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to enforce JMP to open a file in read only mode?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275066#M53372</link>
      <description>&lt;P&gt;Could you just make your JMP table a csv?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 17:07:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275066#M53372</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2020-06-23T17:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to enforce JMP to open a file in read only mode?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275292#M53421</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2610"&gt;@vince_faller&lt;/a&gt;thanks, &amp;nbsp;in my case a jmp table is preferred, I have a small table, that I Need to edit (by JMP).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In another case, when I would have large tables, that are used by many users, also a jmp table would be better, because conversion is not needed, wouldn't it?&lt;/P&gt;&lt;P&gt;Additionally the jmp table has more functionality (scripts, data types …), so I would Always prefer jmp table as filetype.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 21:19:08 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275292#M53421</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2020-06-24T21:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to enforce JMP to open a file in read only mode?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275293#M53422</link>
      <description>&lt;P&gt;A suggestion: the &lt;A href="https://community.jmp.com/t5/JMP-Add-Ins/Add-In-Manager/ta-p/43736" target="_self"&gt;Add-in Manager&lt;/A&gt; that&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/1855"&gt;@Justin_Chilton&lt;/a&gt;&amp;nbsp;created automates the method that&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6878"&gt;@Jeff_Perkinson&lt;/a&gt;&amp;nbsp;described.&amp;nbsp; The add-in updates a .jsl file containing an associative array which is read by users.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 21:31:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275293#M53422</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2020-06-24T21:31:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to enforce JMP to open a file in read only mode?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275300#M53424</link>
      <description>&lt;P&gt;&lt;LI-MESSAGE title="Saving to disk as hidden or read-only" uid="254865" url="https://community.jmp.com/t5/Discussions/Saving-to-disk-as-hidden-or-read-only/m-p/254865#U254865" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;has a RunProgram snippet to run the DOS attrib command. You can mark the file as read-only, or clear the flag.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 22:44:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275300#M53424</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-06-24T22:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to enforce JMP to open a file in read only mode?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275304#M53426</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/9474"&gt;@Georg&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;A few assumptions about your application.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. multiple people aren't writing to metadata simultaneously&lt;/P&gt;
&lt;P&gt;2. it's a read-only call to "is there a new version of one of my apps?&amp;nbsp; Where is it?"&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If both of those are true then I'd normally&amp;nbsp;actually use a SQLite database and make ODBC calls to it.&amp;nbsp; I wouldn't say that there needs to be&amp;nbsp; a lot of bells and whistles if all you're doing is retrieving meta data.&amp;nbsp; Plus you could do stuff like actually store the addin in the database as well.&amp;nbsp; JMP tables are great for lots of things.&amp;nbsp; But for this specific application, I'd say it's overkill.&amp;nbsp; If it's just a throwaway call that you're going to close as soon as you see if there's a new version, ....&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can still easily script it.&amp;nbsp; Again this wouldn't work well if multiple users are writing at the same time. The big thing is that when JMP opens a CSV it doesn't lock the original file like it does with a JMP table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here( 1 );
dt = open("$SAMPLE_DATA\Big Class.jmp");

csv_path = convert file path("$DESKTOP\Big Class.csv");
dt &amp;lt;&amp;lt; Save As(csv_path);
close(dt, no save);
dt_csv = open(csv_path); 
dt_csv &amp;lt;&amp;lt; Add Rows({:name = "Fake", :age = 14, :sex = "F", :height = 14, :weight = 28});
dt_csv:age[1] = 0;
// I can still delete this file even though I have the table open
show(delete file(csv_path));

dt_csv &amp;lt;&amp;lt; Save As(csv_path);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;I'd just generally go without the JMP table functionality than deal with multiple permissions levels.&amp;nbsp; Because if you open a csv in a JMP script, it opens a JMP table that isn't tied&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 23:17:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275304#M53426</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2020-06-24T23:17:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to enforce JMP to open a file in read only mode?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275397#M53443</link>
      <description>&lt;P&gt;&lt;U&gt;Thank you all for so much proposals, I'll try them out and will find a good solution.&lt;/U&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2020 15:12:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-enforce-JMP-to-open-a-file-in-read-only-mode/m-p/275397#M53443</guid>
      <dc:creator>Georg</dc:creator>
      <dc:date>2020-06-25T15:12:28Z</dc:date>
    </item>
  </channel>
</rss>

