Sign in to follow this  
Followers 0
dilleh

Problem with FileCopy function

3 posts in this topic

I'm making a gmail checker widget for bumptop. The way widgets work in BumpTop, in short, is you dynamically generate an image file, and bumptop displays it. Perfect for AutoIT!

The problem arises when I try to overwrite the icon I'm using, a PNG file, with the new one I want it to update as. Here's a link to a video showing this behavior. The AutoIT code doing the overwrite is a simple FileCopy:

FileCopy( "../resources/gCheck-empt.png", "/gCheck.png", 1 )

If I simply overwrite the original file with the new one using explorer while bumptop is running, it works perfectly. The FileCopy command, however, acts as if it deletes it first, then overwrites it. Very odd. Any idea why FileCopy acts is way? Is there a better way?

Share this post


Link to post
Share on other sites



Welcome dilleh,

Your picture displays gCheck.png in a folder named "Temp" though your code is copying to the root ("/gCheck.png") of the drive. IMO, you may want it to copy to the current working directory which would be "./gCheck.png" or use "gCheck.png". Please mention whether this is the issue. :mellow:

Try this for current working directory copy:

FileCopy( "../resources/gCheck-empt.png", "gCheck.png", 1 )

Share this post


Link to post
Share on other sites

I don't think I explained the problem very well, but you did give me the idea for the solution!

I just used Run( @ComSpec & " /c copy... instead

Thanks a ton!

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
Sign in to follow this  
Followers 0