The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: skywalker on February 05, 2006, 02:00:42 PM

Title: Is CopyAFile a legit function?
Post by: skywalker on February 05, 2006, 02:00:42 PM
I found CopyAFile in the larger Win32.hlp file, but it isn't working right. Maybe I don't have the right include or library.

Thanks.

invoke CopyAFile,offset File1, offset File2,cmoOverwrite,0
Title: Re: Is CopyAFile a legit function?
Post by: P1 on February 05, 2006, 07:47:35 PM
It's not a WIN32 api function.  I have found several references to it as a library function for different laguages.

So post some of the information that you have found.  Or at least a web link to the file you are talking about.

Regards,  P1  :8)
Title: Re: Is CopyAFile a legit function?
Post by: Tedd on February 06, 2006, 04:42:55 PM
There is a "CopyFile" function, with parameters: source, destination, and overwrite.
Haven't seen "CopyAFile" though.
Title: Re: Is CopyAFile a legit function?
Post by: P1 on February 06, 2006, 05:12:53 PM
Quote from: Tedd on February 06, 2006, 04:42:55 PM
There is a "CopyFile" function, with parameters: source, destination, and overwrite.
Haven't seen "CopyAFile" though.
I asked him to post the reference, because I believe it will be a CopyFileA from the API.

Regards,  P1  :8)
Title: Re: Is CopyAFile a legit function?
Post by: Vortex on February 06, 2006, 05:31:14 PM
skywalker,

MSDN doesn't give any result if you search that function.
Title: Re: Is CopyAFile a legit function?
Post by: Mincho Georgiev on February 06, 2006, 05:46:38 PM
Actually, skywalker's got a point, because there really is a function named CopyAFile in the Win32Api Reference, declared like that:
VOID CopyAFile(LPSTR szFullPathSrc, LPSTR szFullPathDst, INT cmo, INT fAppend);
But after a little research, i found sh.t :)
As a matter of fact the only file on my PC that have the string "CopyAFile" is the same one that skywalker is saw. the mstools.toc, which is appart from Win32Api Reference (the full version,from Borland's CBulder Package). There is a few people (i didn't recognize their nationality's because the html's was on language that my PC don't support) with a same problem like skywalker's one - they have saw the CopyAFile declaration in Win32Api reference and try to use it with the same (no) result.
That suggests to me a two possibilities:
1st  The function is totally obsolete
2nd Is a some kind of error in the reference (maybe M$ intention was to implement that function,but they didn't)

That is my opinion, there is no guarantees that i'm 100% right, but it is possible!
Title: Re: Is CopyAFile a legit function?
Post by: skywalker on February 06, 2006, 09:34:43 PM
Quote from: shaka_zulu on February 06, 2006, 05:46:38 PM
Actually, skywalker's got a point, because there really is a function named CopyAFile in the Win32Api Reference, declared like that:
VOID CopyAFile(LPSTR szFullPathSrc, LPSTR szFullPathDst, INT cmo, INT fAppend);
But after a little research, i found sh.t :)
As a matter of fact the only file on my PC that have the string "CopyAFile" is the same one that skywalker is saw. the mstools.toc, which is appart from Win32Api Reference (the full version,from Borland's CBulder Package). There is a few people (i didn't recognize their nationality's because the html's was on language that my PC don't support) with a same problem like skywalker's one - they have saw the CopyAFile declaration in Win32Api reference and try to use it with the same (no) result.
That suggests to me a two possibilities:
1st  The function is totally obsolete
2nd Is a some kind of error in the reference (maybe M$ intention was to implement that function,but they didn't)

That is my opinion, there is no guarantees that i'm 100% right, but it is possible!

I  downloaded several win32.hlp files and one of them had the CopyAFile in it. It may have come from a visual basic or C programming language board.

Title: Re: Is CopyAFile a legit function?
Post by: Mincho Georgiev on February 06, 2006, 09:55:12 PM
Quotefrom Borland's CBulder Package
Title: Re: Is CopyAFile a legit function?
Post by: Tedd on February 07, 2006, 11:12:37 AM
I've just 'grep'ed all the dlls in my system32 directory, and there's no mention of copyafile, so I assume it must've come from elsewhere.
Title: Re: Is CopyAFile a legit function?
Post by: Mincho Georgiev on February 08, 2006, 05:53:03 PM
I know, i've already did that and the only file that contains that function is the win32Api ref's one from CBuilder's MSHelp.
The fact that this function is in "mstools.hlp" defenately exclude the option this would be an API function!
Is a part from the complete borland's Win32Api reference package.
The materials that i've found was written by an CBuilder users, and no doubt that CopyAFile function is not a part from Borland class interface for cbuilder neither.
Anyway there is no enought info anywhere about it, so no way for us to figure it out with a 100% guarantee.
The only thing that i'm sure in is that even if CopyAFile is a "legit" function, is not an win32 API function at all !
check it out if you like:

ftp://ftp.borland.com/pub/bcppbuilder/techpubs/bcb5/b5ms.zip
Title: Re: Is CopyAFile a legit function?
Post by: Mincho Georgiev on February 08, 2006, 06:04:51 PM
And i want to add something at the end, as i said before, CopyAFile is from MSTOOLS.hlp, so im 99% sure that is apart from a ms tool associated functions.
Maybe .msi or something.
Bye for now.

p.s. Skywalker, you better choose CopyFile or CopyFileEx instead of this and forget it,it's not worth the time loosing.
Title: Re: Is CopyAFile a legit function?
Post by: donkey on February 08, 2006, 06:50:55 PM
Probably mean CopyFileA which is the ANSI wrapper for CopyFile.
Title: Re: Is CopyAFile a legit function?
Post by: Casper on February 08, 2006, 09:37:50 PM
Donkey,
This is offtopic but I am sure others want to know, also.  Do you intend to put your webpage back up at some point.  There was some very useful stuff you had there; a nice resource.

Casper.
Title: Re: Is CopyAFile a legit function?
Post by: gwapo on February 10, 2006, 07:32:33 AM
In Win32, CopyAFile is a setup related function, which means it is part of the setup SDK, i.e., when you are working with MSI for example, you can use it by including Setup.h header file that comes from the setup SDK to your program.

In general programming (not thinking about setup SDK), it would be best not to use CopyAFile function since it is only a wrapper function to make ease the call between CopyFileA and CopyFileW functions. Your application will be able to determine between ANSI and Unicode without the help of setup SDK, and use the most appropriate function.


-chris