Home/Support/Support Forum/Append/modify same file in xbee file system

Append/modify same file in xbee file system

0 votes
I am using XBee 3 RF module, I wanted to test the I/o file system. To test I used simple code where it will open file as an append mode and will write Hello World! and followed with file close in every 1 second interval but problem what I am facing is once file was opened in append mode next time to open the same file in append mode causing an os error as 'EEXIT' which means file already exist.
In Digi Xbee 3 user manual I went through file system limitation but I did not find any limitation regarding append/modify file


Below is the code for the above details. I wanted to know Is that possible to append/modify the file once again without removing or deleting
the file from file system?

NOTE: I used file as xbee.txt

import uio, uos

while True:
print('Open a file')
with uio.open("xbee.txt",mode='a') as txt:
size = txt.write("Hello World!\n")
txt.close()
time.sleep(1)
asked Aug 7 in RF Solutions and XBee by ANOM New to the Community (1 point)

Please log in or register to answer this question.

1 Answer

0 votes
http://cms.digi.com/resources/documentation/digidocs/90002219/#reference/r_access_data.htm?Highlight=Edit%20file

http://cms.digi.com/resources/documentation/digidocs/90002219/#reference/r_method_close.htm%3FTocPath%3DAccess%2520file%2520system%2520in%2520MicroPython%7CFile%2520object%2520methods%7C_____9
answered Aug 7 by mvut Veteran of the Digi Community (13,036 points)
...