Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    get file time over network

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 440 Views
    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.
    • H Offline
      Helper
      last edited by

      On 15/04/2013 at 04:37, xxxxxxxx wrote:

      Hi There,

      Im trying to read out the file modfication time.
      on my local machine this code works. but not for files that are in the network. the file I am trying to access is easily accessible via windows explorer, but unfortunately not with python.

      any ideas?
      thanks a lott
      Jops

        
      import c4d, os, time   
      from c4d import gui   
      #Welcome to the world of Python   
        
        
      def main() :   
          print time.localtime(os.path.getmtime("\\networkcomputerOrIP\foler\file"))   
        
      if __name__=='__main__':   
          main()   
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 15/04/2013 at 05:02, xxxxxxxx wrote:

        you did not escape your string properly in your example. you have either use a raw string
        or escape the backlash character.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 20/04/2013 at 09:55, xxxxxxxx wrote:

          first, sorry for my late relpy,

          got distraced from work 🙂

          second thanks for the info.
          I'm not jet comletely shure if I understand what to do, but I'm hopefull to find it out 🙂

          thanks
          Jops

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 20/04/2013 at 14:26, xxxxxxxx wrote:

            mystring = "\\\\networkcomputerOrIP\\foler\\file" #escaped backlash char
            mystring = r"\\networkcomputerOrIP\foler\file"    #raw string

            the backlash character is a control character for python strings. ( - tab, \n - newline, ..)

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 21/04/2013 at 09:28, xxxxxxxx wrote:

              Super.... thanks a lot

              1 Reply Last reply Reply Quote 0
              • First post
                Last post