Copying a File!

BlitzMax Forums/BlitzMax Beginners Area/Copying a File!

Hardcoal(Posted 2012) [#1]
Why does copyfile doesn't work?

Example:
CopyFile ("C:\5_jupiter.png", "D:\")

I expect that the png which weights 86k to appear on D:\ but it doesn't.

Any Idea why?


GfK(Posted 2012) [#2]
Cos you need to specify the target filename, not just the path.


Hardcoal(Posted 2012) [#3]
I see thanks ill give it a shot.

Well it works...

I guess some things are better asking then waisting time trying.

Last edited 2012


GaryV(Posted 2012) [#4]
I guess some things are better asking then waisting time trying.


Or you could always just RTFM


CopyFile( src$,dst$ )

Returns:

True if successful
Description:

Copy a file 



*(Posted 2012) [#5]
@GaryV: TBH the manual description is very vague for example at cmd line you could use "copy myfile.png D:" maybe changing the help doc so it must have a filename for destination would clear up any misunderstandings in the future.


GfK(Posted 2012) [#6]
Yeah the documentation is vague - it does not state that you need to specify the whole path AND filename in dst$. So it could be (wrongly) assumed that dst$ requires only the target path, and that the file will be copied with it's original name.


Midimaster(Posted 2012) [#7]
That's why I always say a example is a "must have" in every documentation. sometimes it helpes more than a long description.

"A language is as famous a it it usable".

At the moment I try to use ANDROID sdk inside monkey, but the android documentation has no samples. So I never know how the exact syntax is. If you firm with android this cetainly will be no problem, but as a newby you are always in doubt...


At the same time I have to code something in PHP, where I'm also not very firm. But here the documentaion always has a runable code sample, which makes me feel strong.

I think we should always listen to newbies and their "apparently stupid" questions to improve the software. Newbies are the purchaser of tomorrow.