cjnaz / rclonesync-V2

A Bidirectional Cloud Sync Utility using rclone
MIT License
357 stars 39 forks source link

FileNotFoundError: [Errno 2] No such file or directory in Lock file in windows10 #28

Closed chungyan5 closed 5 years ago

chungyan5 commented 5 years ago

hi

i got this error when i first time use this rclonesync-V2.

2019-07-07 09:16:56,202:  ***** BiDirectional Sync for Cloud Services using rclone *****
Traceback (most recent call last):
  File "C:\Portable\rclonesync\rclonesync.py", line 730, in <module>
    if request_lock(sys.argv, lock_file) == 0:
  File "C:\Portable\rclonesync\rclonesync.py", line 539, in request_lock
    with open(lock_file, 'w') as fd:
FileNotFoundError: [Errno 2] No such file or directory: 'C:/tmp/rclonesync_LOCK_xxxxxx_xxxxxx__xxxxxx_xxxxxx__xxxxxx__xxxxxx_xxxxxx_'

i find it is hardcode of temporary file at C:/tmp/ So i suggest to add this module:

import tempfile
...
    if os_platform == 'Windows':
        lock_file = tempfile.gettempdir() + "/rclonesync_LOCK_" + lock_file_part
...

thanks chungyan5

cjnaz commented 5 years ago

Thanks. The README says that the C:\tmp directly must be manually created. Your code looks interesting. I'll check it out.

On Sat, Jul 6, 2019, 7:01 PM Cheng Chung Yan notifications@github.com wrote:

hi

i got this error when i first time use this rclonesync-V2.

2019-07-07 09:16:56,202: BiDirectional Sync for Cloud Services using rclone Traceback (most recent call last): File "C:\Portable\rclonesync\rclonesync.py", line 730, in if request_lock(sys.argv, lock_file) == 0: File "C:\Portable\rclonesync\rclonesync.py", line 539, in request_lock with open(lock_file, 'w') as fd: FileNotFoundError: [Errno 2] No such file or directory: 'C:/tmp/rclonesync_LOCK_xxxxxx_xxxxxx__xxxxxx_xxxxxxxxxxxxxxxxxxxxxxxx'

i find it is hardcode of temporary file at C:/tmp/ So i suggest to add this module:

import tempfile ... if os_platform == 'Windows': lock_file = tempfile.gettempdir() + "/rclonesyncLOCK" + lock_file_part ...

thanks chungyan5

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cjnaz/rclonesync-V2/issues/28?email_source=notifications&email_token=ADRKVYOBEPALRZSVBO6BMJTP6FE6TA5CNFSM4H6UTWX2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G5V5ERQ, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRKVYIJEG7C7CZ3UHWWPC3P6FE6TANCNFSM4H6UTWXQ .

silenceleaf commented 5 years ago

I vote @chungyan5 's solution, rather than create c:\temp manually

cjnaz commented 5 years ago

Changed in V2.8. Thanks for the suggestion.