Jump to content
Sign in to follow this  
legiom455

FileCopy ...

Recommended Posts

legiom455

I'm in need of either some help with FileCopy or a link to where I can find more info about this:

I've looked in quite a few tutorials, and examples, yet haven't found help about:

1. Need to copy a file, w/ overwrite

FileCopy ("esettings_evzap.xml", "esettings.xml", 1)

2. Need to wait until the files gets copied,.... then check the error code: 1, success, 0 fail

3. If Success, then process more code,... otherwise, .. send error message to the screen.

...

yep, you guessed it, I'm a big noob,...

note: the destination file already exists,...

Any help, links,.. most appreciated.

I even tried to find a udf,... anything I've found, shows progress bars,... using 100 lines of code or more.... which isn't what I need....

thanks again guys!

Allen

Edited by legiom455

Share this post


Link to post
Share on other sites
kylomas

legiom455,

All you need is in the help file. What have you tried and what has not worked?

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites
JLogan3o13

legiom455, you've almost written your pseudocode in your own post:

1. Need to copy a file, w/ overwrite

FileCopy ("esettings_evzap.xml", "esettings.xml", 1)

2. .... then check the error code: 1, success, 0 fail

3. If Success, then process more code,... otherwise, .. send error message to the screen.

Why not post the code you have as Klyomas suggests, so we can help you :oops:


√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
legiom455

Well, the below seems to be working,... but now, my question is how do I add error checking?

Thanks again for helping!!.... most appreciated!

Func legionButton()
$done = FileCopy (".Jukeboxeversionsettingsesettings_evzap.xml", ".Jukeboxeversionsettingsesettings.xml", 1)
While  $done = 0
WEnd
$done = FileCopy (".JukeboxevZapsettings_legion.xml", ".JukeboxevZapsettings.xml", 1)
While  $done = 0
WEnd
ShellExecute(".Jukeboxeversion.swf")
WinWaitActive("Adobe Flash Player Security")
Send("{ENTER}")
EndFunc

Share this post


Link to post
Share on other sites
JLogan3o13

There are numerous ways to do this, checking the return from FileCopy. Why not something like this:

legionButton()

Func legionButton()

$done = FileCopy("C:esettings_evzap.xml", "C:esettings.xml", 1)
  If $done = "1" Then
   ShellExecute(".Jukeboxeversion.swf")
  Else
   MsgBox(0, "", "File did not copy correctly.")
  EndIf

EndFunc
Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites
legiom455

hmmm,, I have two files I'm copying,... :oops:

I thought I had to use ... If @error = 0 or something like this

Seems like I'm using the wrong thing for "file is copied"...

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  

×