# Textfile in net+os using the digi

**URL:** <https://forums.digi.com/t/textfile-in-net-os-using-the-digi/4222>\
**Category:** NET+OS\
**Tags:** text-file\
**Created:** [June 3, 2010, 12:53pm UTC](https://forums.digi.com/t/textfile-in-net-os-using-the-digi/4222 "2010-06-03T12:53:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timmie](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@Timmie](https://forums.digi.com/u/Timmie)\
**Post date:** [June 3, 2010, 12:53pm UTC](https://forums.digi.com/t/textfile-in-net-os-using-the-digi/4222/1 "2010-06-03T12:53:30Z")

</div>

Hello

im using several text files in my program to write data to. I use a ajax application that reads out the data again. But im having a problem at that i can only created a textfile and write data to it. After i close the File descriptor i cannot open it again and write data to it. Here is my code i really hope some one can help me with it.

fdtext = open(Text6, (O\_CREAT | O\_RDWR ),NASYSACC\_LEVEL\_RW );

write(fdtext," 3# Meter 1 # nh-22# Voltage# 0# Volt#“, strlen(” 1# Meter 1 # nh-22# Voltage# 0# Volt#"));

```
write(fdtext,"test", strlen("test"));
close(fdtext);
tx_thread_sleep(10);

```

fdtext = open(Text6, (O\_CREAT | O\_RDWR ),NASYSACC\_LEVEL\_RW );  
tx\_thread\_sleep(10);  
write(fdtext,“monkey”, strlen(“monkey”));  
close(fdtext);  
tx\_thread\_sleep(10);

In the textfile onley the first 2 writes are there. The last one wont be able to write. Any help on the matter would be great

Yours sincerely,

Tim

---

<div class="post-metadata">

**Author:** ![Timmie](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@Timmie](https://forums.digi.com/u/Timmie)\
**Post date:** [June 4, 2010, 10:10am UTC](https://forums.digi.com/t/textfile-in-net-os-using-the-digi/4222/2 "2010-06-04T10:10:11Z")

</div>

Hi again

i fixed my textfile problem. The problem was that the browers were storing my old textfile in the cache memory and not reloading it everytime. Still havent fixed this problem but im getting closer

tim

---

<div class="post-metadata">

**Author:** ![charliek](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@charliek](https://forums.digi.com/u/charliek)\
**Post date:** [June 9, 2010, 4:07pm UTC](https://forums.digi.com/t/textfile-in-net-os-using-the-digi/4222/3 "2010-06-09T16:07:04Z")

</div>

O\_CREAT attempts to create the file. Try opening it up the second time without O\_CREAT.

---

<div class="post-metadata">

**Author:** ![Timmie](https://avatars.discourse-cdn.com/v4/letter/t/b9e5f3/32.png) [@Timmie](https://forums.digi.com/u/Timmie)\
**Post date:** [June 11, 2010, 8:32am UTC](https://forums.digi.com/t/textfile-in-net-os-using-the-digi/4222/4 "2010-06-11T08:32:49Z")

</div>

thx for the reply, I already fixed the problem. I thought in the begining that the text file was not writing/ updating but the problem was that the browser was getting the same text file with same size so it did not update it, it just got the old one from the cache memory from the browser. Fixed that problem on the ajax side. but thx for the reply

yours sincerely

tim
