<?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 How to create a file using python in exos in ExtremeSwitching (EXOS/Switch Engine)</title>
    <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-to-create-a-file-using-python-in-exos/m-p/73442#M19097</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to create a local file for writing and looks like I don't have a permission to do so.&lt;BR /&gt;
I'm using custom created account but with admin privleges.&lt;BR /&gt;
&lt;BR /&gt;
Is there any place in EXOS filesystem with write permissions?</description>
    <pubDate>Thu, 11 Apr 2019 18:31:16 GMT</pubDate>
    <dc:creator>Mateusz_Haba</dc:creator>
    <dc:date>2019-04-11T18:31:16Z</dc:date>
    <item>
      <title>How to create a file using python in exos</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-to-create-a-file-using-python-in-exos/m-p/73442#M19097</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to create a local file for writing and looks like I don't have a permission to do so.&lt;BR /&gt;
I'm using custom created account but with admin privleges.&lt;BR /&gt;
&lt;BR /&gt;
Is there any place in EXOS filesystem with write permissions?</description>
      <pubDate>Thu, 11 Apr 2019 18:31:16 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-to-create-a-file-using-python-in-exos/m-p/73442#M19097</guid>
      <dc:creator>Mateusz_Haba</dc:creator>
      <dc:date>2019-04-11T18:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a file using python in exos</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-to-create-a-file-using-python-in-exos/m-p/73443#M19098</link>
      <description>You can use the &lt;A href="https://docs.python.org/3/library/functions.html#open" target="_blank" rel="nofollow noreferrer noopener"&gt;open()&lt;/A&gt; function. I am using an admin account called pythonuser and running a pythong script that creates a file called &lt;B&gt;thisFileWasCreatedWithPython.log.&lt;/B&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;    fileName = "thisFileWasCreatedWithPython"&lt;BR /&gt;    f = open('/usr/local/cfg/' + fileName + '.log', 'a')&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
 I have RW permissions on the file after running my script:&lt;BR /&gt;
&lt;BR /&gt;
&lt;DIV class="threadCode"&gt;&lt;B&gt;code:&lt;/B&gt;&lt;PRE spellcheck="false"&gt;# ls *.log&lt;BR /&gt;-rw-r--r--    1 admin    admin      241770 Apr 11 21:29 thisFileWasCreatedWithPython.log&lt;BR /&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;
&lt;BR /&gt;
What version of EXOS are you using and can if you try the using the above in your script are you running into the same read only permission problem?</description>
      <pubDate>Thu, 11 Apr 2019 22:40:36 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-to-create-a-file-using-python-in-exos/m-p/73443#M19098</guid>
      <dc:creator>Kawawa</dc:creator>
      <dc:date>2019-04-11T22:40:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a file using python in exos</title>
      <link>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-to-create-a-file-using-python-in-exos/m-p/73444#M19099</link>
      <description>Dunno why but I tried to create a file in /usr/local/cfg before and couldn't. I also tried at /usr/local/tmp but that didn't work either. Finally, I did it like this at /usr/local/cfg:&lt;BR /&gt;
&lt;BR /&gt;
with open('test.xsf','w') as f:&lt;BR /&gt;
	f.write('something to file')&lt;BR /&gt;
&lt;BR /&gt;
Thanks </description>
      <pubDate>Fri, 12 Apr 2019 13:44:56 GMT</pubDate>
      <guid>https://community.extremenetworks.com/t5/extremeswitching-exos-switch/how-to-create-a-file-using-python-in-exos/m-p/73444#M19099</guid>
      <dc:creator>Mateusz_Haba</dc:creator>
      <dc:date>2019-04-12T13:44:56Z</dc:date>
    </item>
  </channel>
</rss>

