Jump to content

FileMove return success but still did not the job properly


Recommended Posts

When I try to move file named "testfile.txt" from directory1 (source) to directory2 (destination) with function FileMove then sometimes It will copy that file to new directory2 but leave old file in direcotry1 changing it's name to "testfile (1).txt" instead of deleting it. Other time it will also success to copy to new directory2 but leave two source files "testfile.txt" and "testfile (1).txt" in destination1. In both cases function FileMove returned success. I am not sure but maybe it is caused by syncing that files by google drive pc app during filemove process. I will change destination1 to another folder which will not be synced with google drive to see if it will fix the problem but anyway I am curious why FileMove still returned success? Shouldn't it check if source file still exist before it return success? Is there any UDF or something to detect all errors which might occur during file move like:

- check if destination2 exists

- check if destination2 has enought free space

- check if source file has been deleted successfully without leaving any copy of that file

- check if source file is not used by another process

Any idea? comments? suggestions?

Edited by maniootek
Link to comment
Share on other sites

I use "$FC_OVERWRITE (1)" and "$FC_CREATEPATH (8)" flag

Lovely.

Show reproducer code, I'll be happy to test.

Because Filemove has never ever failed me where the function is used properly and my expectations are correct.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

I have the same problem when moving or deleting files in Google Drive folders that are synced between 2 computers, usually if i wait then the two computers sync up correctly and the leftover files get deleted.

:alien:

If @error Then
    MsgBox(262192, "", @ComputerName & " slaps " & @UserName & " around a bit with a large trout!")
EndIf

"Yeah yeah yeah patience, how long will that take?"  -Ed Gruberman

REAL search results  |  SciTE4AutoIt3 Editor Full Version

Link to comment
Share on other sites

I just did first try to process FileMove function without directory used by Google Drive and everything goes fine. I will leave it but I still suggest that FileMove should not return success when did not delete source file properly.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...