MechE

Raspberry Pi: Syncing Issue when appending datafiles

Recommended Posts

My Objective: Put a constantly updating file into the Resilio Sync folder.

Problem: When I run my code, the updating file appears in the raspberry pi synced folder; however, 
it does not sync to my other computers unless the python code is no longer running.

I've found that the following code syncs perfectly with Resilio:
 
 #Send IP Address Information to the Folder
  f = open("/home/pi/Desktop/folder/Data/ipAddress.txt","w+")
  f.write(str(ipPrint))
  f.close() 

The files that don't sync are the ones that are appended ,"a+":
for port in activeports:
		files[index] = open("/home/pi/Desktop/folder/Data/" + "20" + filedate.strftime('%y_%m_%d_') + str(devices[index]) + ".csv","a+") 

Do you guys have any idea on what's happening? 
Thanks in advance!

 

 

Edited by MechE
formatting

Share this post


Link to post
Share on other sites
On 8/13/2017 at 6:00 AM, MechE said:

I've found that the following code syncs perfectly with Resilio:  
#Send IP Address Information to the Folder f = open("/home/pi/Desktop/folder/Data/ipAddress.txt","w+") f.write(str(ipPrint)) f.close()

is it the file name or its content? 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.