<?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: Unable to write/create a file through TCL command in Nexus Devices</title>
    <link>https://community.cisco.com/t5/nexus-devices/unable-to-write-create-a-file-through-tcl-command/m-p/4395581#M166</link>
    <description>&lt;P&gt;Hi, yeah, it's empty beacause the original message was like "there's not such file", so I thought maybe it need the file to already exists so I created empty...&lt;/P&gt;&lt;P&gt;Now, I've just uploaded a new file with some content and yes I can read it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;N7K-CORE# show file bootflash:clock.log
Sample Text
working on it...
N7K-CORE# &lt;/PRE&gt;&lt;P&gt;I tried the same tests and I aaded the last line, so I thought it works without slashes:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;N7K-CORE-tcl# open bootflash:///clock.log "a+"
couldn't open "bootflash:///clock.log": no such file or directory
N7K-CORE-tcl# open bootflash://clock.log "a+"
couldn't open "bootflash://clock.log": no such file or directory
N7K-CORE-tcl# open bootflash:/clock.log "a+"
couldn't open "bootflash:/clock.log": no such file or directory
N7K-CORE-tcl# open bootflash:clock.log "a+"
&lt;STRONG&gt;file37&lt;/STRONG&gt;
N7K-CORE-tcl# &lt;/PRE&gt;&lt;P&gt;I tried again writing in the file without the slashes but It's waiting for an integer... I tried the integer and it didn't write anything:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;N7K-CORE-tcl# open bootflash:clock.log "a+" {
&amp;gt; "insert new line here"
&amp;gt; }
expected integer but got "
"insert new line here"
"
N7K-CORE-tcl# open bootflash:clock.log "a+" {
&amp;gt; 256
&amp;gt; }
file38
N7K-CORE-tcl# exit
N7K-CORE# show file bootflash:clock.log
Sample Text
working on it...
N7K-CORE1# &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any other idea? Anyway, thanks for your time&lt;/P&gt;</description>
    <pubDate>Thu, 29 Apr 2021 15:41:38 GMT</pubDate>
    <dc:creator>ahuamancayo</dc:creator>
    <dc:date>2021-04-29T15:41:38Z</dc:date>
    <item>
      <title>Unable to write/create a file through TCL command</title>
      <link>https://community.cisco.com/t5/nexus-devices/unable-to-write-create-a-file-through-tcl-command/m-p/4395145#M164</link>
      <description>&lt;P&gt;Hello Everyone!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create/write a file in bootflash: through a script and It fails... I tried to run the command directly in the TCLSH interpreter but I get this message:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;N7K-CORE# tclsh
N7K-CORE-tcl# open bootflash:///clock.log "a+"
couldn't open "bootflash:///clock.log": no such file or directory
N7K-CORE-tcl# open bootflash://clock.log "a+"
couldn't open "bootflash://clock.log": no such file or directory
N7K-CORE-tcl# open bootflash:/clock.log "a+"
couldn't open "bootflash:/clock.log": no such file or directory

N7K-CORE-tcl# dir
4096 Apr 28 17:32:52 2021 Scripts/
0 Apr 28 17:30:22 2021 clock.log
0 Apr 28 17:29:44 2021 infoTAC.log
664 Sep 29 15:22:10 2014 vlan.dat

Usage for bootflash://
1281138688 bytes used
535347200 bytes free
1816485888 bytes total
N7K-CORE-tcl# exit&lt;/PRE&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Adrian&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/613951"&gt;@TCL&lt;/a&gt; &lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/500776"&gt;@nexus&lt;/a&gt; &lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/535654"&gt;@nx&lt;/a&gt;-os&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 00:01:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nexus-devices/unable-to-write-create-a-file-through-tcl-command/m-p/4395145#M164</guid>
      <dc:creator>ahuamancayo</dc:creator>
      <dc:date>2021-04-29T00:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to write/create a file through TCL command</title>
      <link>https://community.cisco.com/t5/nexus-devices/unable-to-write-create-a-file-through-tcl-command/m-p/4395300#M165</link>
      <description>&lt;P&gt;Can you able to read the file :&amp;nbsp; (it is 0 size ?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;show file  &lt;/STRONG&gt;bootflash://clock.log&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 08:58:43 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nexus-devices/unable-to-write-create-a-file-through-tcl-command/m-p/4395300#M165</guid>
      <dc:creator>balaji.bandi</dc:creator>
      <dc:date>2021-04-29T08:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to write/create a file through TCL command</title>
      <link>https://community.cisco.com/t5/nexus-devices/unable-to-write-create-a-file-through-tcl-command/m-p/4395581#M166</link>
      <description>&lt;P&gt;Hi, yeah, it's empty beacause the original message was like "there's not such file", so I thought maybe it need the file to already exists so I created empty...&lt;/P&gt;&lt;P&gt;Now, I've just uploaded a new file with some content and yes I can read it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;N7K-CORE# show file bootflash:clock.log
Sample Text
working on it...
N7K-CORE# &lt;/PRE&gt;&lt;P&gt;I tried the same tests and I aaded the last line, so I thought it works without slashes:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;N7K-CORE-tcl# open bootflash:///clock.log "a+"
couldn't open "bootflash:///clock.log": no such file or directory
N7K-CORE-tcl# open bootflash://clock.log "a+"
couldn't open "bootflash://clock.log": no such file or directory
N7K-CORE-tcl# open bootflash:/clock.log "a+"
couldn't open "bootflash:/clock.log": no such file or directory
N7K-CORE-tcl# open bootflash:clock.log "a+"
&lt;STRONG&gt;file37&lt;/STRONG&gt;
N7K-CORE-tcl# &lt;/PRE&gt;&lt;P&gt;I tried again writing in the file without the slashes but It's waiting for an integer... I tried the integer and it didn't write anything:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;N7K-CORE-tcl# open bootflash:clock.log "a+" {
&amp;gt; "insert new line here"
&amp;gt; }
expected integer but got "
"insert new line here"
"
N7K-CORE-tcl# open bootflash:clock.log "a+" {
&amp;gt; 256
&amp;gt; }
file38
N7K-CORE-tcl# exit
N7K-CORE# show file bootflash:clock.log
Sample Text
working on it...
N7K-CORE1# &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any other idea? Anyway, thanks for your time&lt;/P&gt;</description>
      <pubDate>Thu, 29 Apr 2021 15:41:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nexus-devices/unable-to-write-create-a-file-through-tcl-command/m-p/4395581#M166</guid>
      <dc:creator>ahuamancayo</dc:creator>
      <dc:date>2021-04-29T15:41:38Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to write/create a file through TCL command</title>
      <link>https://community.cisco.com/t5/nexus-devices/unable-to-write-create-a-file-through-tcl-command/m-p/5056725#M437</link>
      <description>&lt;P&gt;Hey&amp;nbsp;ahuamancayo&lt;/P&gt;&lt;P&gt;Did you solve your issue? I am at the same situation and am clueless. Since the different departments of cisco dont talk to eachother we cannot manage our nexus switche with prime/DNAC so we are looking for a way to periodically upload our running config as a sanitized version (all PWs removed) to a central server. So I wrote a TCL script for it which works great on IOS-XE but not on NX-OS. It seems, it cant write into a file on the bootflash, just as you described. First i tested creating a file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;swRZ112# tclsh 
swRZ112-tcl# set writefile [open "bootflash:example.txt" "a+"]
file37
swRZ112-tcl# puts $writefile "dunno"
swRZ112-tcl# close $writefile
swRZ112-tcl# tclquit
Exiting Tcl
swRZ112# dir bootflash: | include txt&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;But the file does not exist. Then i created a file and wanted to add something with TCL:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;swRZ112# show version | include uptime
Kernel uptime is 178 day(s), 2 hour(s), 19 minute(s), 41 second(s)
swRZ112# show version | include uptime &amp;gt; bootflash:txtfile.txt
swRZ112# tclsh
swRZ112-tcl# set write2file [open "bootflash:txtfile.txt" "a+"]
file37
swRZ112-tcl# puts $write2file "exampletext"
swRZ112-tcl# close $write2file
swRZ112-tcl# tclquit
Exiting Tcl
swRZ112# show file bootflash:txtfile.txt
Kernel uptime is 178 day(s), 2 hour(s), 20 minute(s), 7 second(s)&lt;/LI-CODE&gt;&lt;P&gt;But sadly, this does not work either. Did you find a solution to your problem? I read thru all Cisco documentation regarding NX-OS and TCL but it is very sparse and there is no file handling bit. Thanks for your answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 20:40:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nexus-devices/unable-to-write-create-a-file-through-tcl-command/m-p/5056725#M437</guid>
      <dc:creator>mario.jost</dc:creator>
      <dc:date>2024-04-04T20:40:05Z</dc:date>
    </item>
  </channel>
</rss>

