omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Refresh /pull from icloud

    Pythonista
    4
    13
    5619
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • rb
      rb last edited by

      Hi
      I have 2 iPads - I’m sharing a text file in an iCloud folder that I’m writing to on one iPad and reading from on the other. Is there a way of pulling or updating a specific file in the iCloud folder structure with a command?

      cvp 1 Reply Last reply Reply Quote 0
      • cvp
        cvp @rb last edited by cvp

        @rb Assume that you have in iCloud Drive, a folder MyFolder containing a file MyFile.ext, you can access it in Pythonista as a normal file, if you open once the folder via open in External Files of the Pythonista files browser.

        path = '/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/MyFolder/MyFile.ext'  
        

        Write with

        path = '/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/MyFolder/MyFile.txt' 
        with open(path,'wt') as fil:
        	fil.write('content\n') 
        

        Read with

        path = '/private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/MyFolder/MyFile.txt' 
        with open(path,'rt') as fil:
        	t = fil.read()
        print(t) 
        

        rb 1 Reply Last reply Reply Quote 0
        • rb
          rb @cvp last edited by

          @cvp thanks for your reply - I’m already doing what you suggest ie I have this working such that when I run the program on the ā€œreaderā€ iPad it will read the file I have written to with the other iPad/program.
          My issue is that it only does this once. Ie I run the reader and it works fine but if I change the file with the writer the reader is not updating the data. The reader is constantly checking the file (and I’ve tested this on the writer) but the actual file isn’t changing as I need to refresh/pull the file from iCloud.So what I’m after is a command that will update the iCloud folder or preferably just the file itself.

          cvp 1 Reply Last reply Reply Quote 0
          • cvp
            cvp @rb last edited by

            @rb I'm sorry but I'm not sure that I correctly understand.
            Anyway, it is sure that the update is not instantaneous. Thus, if you writer modifies the file, it has to be (aitomatically) uploaded to the cloud on the idevice where your writer runs. Then, some time later, the file would be (automatically) downloaded on the idevice where your reader runs, then when this reader will run, you should have the new content of your file.

            1 Reply Last reply Reply Quote 0
            • rb
              rb last edited by

              Hmm yeah it’s the ā€œautomaticallyā€ bit I want to manually run - ie force the file to update as quickly as possible.

              cvp 1 Reply Last reply Reply Quote 0
              • cvp
                cvp @rb last edited by

                @rb I've already remarked that when I try to open a file, it downloads Immediately but the upload is not always so quick, it is in a kind of uploads queue, so even if you could ask the download, not sure the last update is already in the cloud 😢

                1 Reply Last reply Reply Quote 0
                • rb
                  rb last edited by

                  Seems to be working now I changed my reader device (old iPad mini) iCloud settings to passwords/accounts>push data ON an option not on my other iPad (iPad Pro) ...there’s a slight delay but it reads and updates ! Woop!

                  1 Reply Last reply Reply Quote 1
                  • madivad
                    madivad last edited by

                    Interesting that you mention the push data setting... I too have been having issues having iCloud sync between devices. This wasn’t a problem before updating my iPad to iOS 13, that’s possibly not related, but it sure seems to be.

                    I have to manually force an update every time to get data in pythonista shared via the iCloud mechanism, it’s becoming a real PITA. (As discussed in this thread: https://forum.omz-software.com/topic/6091/icloud-syncing-and-pythonista )

                    I’m curious, you talk about the push data setting on an older iPad mini, I was wondering what iOS version? And would you be able to describe in great detail where that exact setting is? I’ve search in both devices and I’m not seeing anything that gives me that specifically. I’m guessing my iOS is probably newer than that iPad (my phone is iOS 12 and the iPad iOS 13).

                    cvp 2 Replies Last reply Reply Quote 0
                    • cvp
                      cvp @madivad last edited by

                      @madivad even in iOS 13, you have this setting in the mails and accounts, at the bottom

                      1 Reply Last reply Reply Quote 0
                      • cvp
                        cvp @madivad last edited by

                        @madivad

                        madivad 1 Reply Last reply Reply Quote 0
                        • madivad
                          madivad @cvp last edited by

                          @cvp yeah that’s it, from your previous post (before this one) I went looking and did find it...

                          Yeah, they are both set to push, I was kinda hopeful for a moment that was the problem, but it does not appear so... :(

                          1 Reply Last reply Reply Quote 0
                          • rb
                            rb last edited by

                            Hi yes sorry just seen this - that’s indeed the setting but on the mini (iOS) it seems to not be restricted or specific to mail but I could be wrong.Also it could all be a coincidence I guess.

                            1 Reply Last reply Reply Quote 0
                            • dng88
                              dng88 last edited by

                              Cannot find this other than under mail, not on my ios13 both iphone and ipad. If have might solve the issue. Any hint how to find them.

                              1 Reply Last reply Reply Quote 0
                              • First post
                                Last post
                              Powered by NodeBB Forums | Contributors