maniootek

FileMove return success but still did not the job properly

11 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



Depends on the flag you use and the attributes of the files used.

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

If you say that this function never failed for you then I will do more research about it. Maybe there's something else what cause this problem.

Share this post


Link to post
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

>Exit code: 0

REAL search results

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

Share this post


Link to post
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.

Share this post


Link to post
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