I am using Borland Builder, but my task is probably a windows api thing…
I am simply trying to copy a file from one location to another (Giving a warning if the destination file already exists, but that part is secondary) but I am having a hard time trying to find out how.
I thought about asking this direct, but I figured it would be useful to have one-on-one contacts for questions like this. The newsgroups and forums may as well be extinct… I could ask the question and grow a long beard waiting for an answer.
My filename source is AnsiString but I know how to turn it into a c string (‘Filename.c_str()’)
You want to use CopyFileEx() to do the copy, you can choose whether it fails or not if the file exists, and use that to implement your “query before overwriting” option:
Call it once with the COPY_FILE_FAIL_IF_EXISTS flag, if it returns that the copy exists, query the user and call again without the flag if appropriate.
As for IM, I fond them disruptive, and I’m at work most days, but my e-mail address should be valid in my profile.
Thanks. I did it with CopyFile in the end (less options than copyfileex, but I found it by searching for copyfileex and I didn’t need the extra functionality)