get file time over network

  • 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

    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__':   

  • 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.

  • 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 :)


  • 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, ..)

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

    Super.... thanks a lot

Log in to reply