Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

CopyFile() funkcija objasnjenje

[es] :: C/C++ programiranje :: CopyFile() funkcija objasnjenje

[ Pregleda: 4104 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

xeron
Sarajevo

Član broj: 25909
Poruke: 133
*.PPPoE-4544.sa.bih.net.ba.



Profil

icon CopyFile() funkcija objasnjenje09.09.2006. u 13:20 - pre 214 meseci
Treba mi objasnjenje (detaljno ako nije prob.) sta radi ova funkcija:

Code:

CopyFile(_argv[0],find.cFileName, 0);



if (argc > 1 && strcmp(argv[1], "-advice") == 0) {
printf("Don't Panic!n");
exit(42);
}
 
Odgovor na temu

Nibble

Član broj: 63173
Poruke: 302
*.dlp12.bih.net.ba.



+1 Profil

icon Re: CopyFile() funkcija objasnjenje09.09.2006. u 19:20 - pre 214 meseci
Code:
CopyFile(Fajl_Koji_Hoces_Kopirati.extenzija,Gdje_Zelis_Kopirati.extenzija,FALSE/TRUE)

Stavi TRUE ako neces da tvoj fajl prepise vec postojeci fajl a FALSE ako to zelis.
evo opis iz MSDN-a

Code:

BOOL CopyFile(
  LPCTSTR lpExistingFileName,
                          // pointer to name of an existing file
  LPCTSTR lpNewFileName,  // pointer to filename to copy to
  BOOL bFailIfExists      // flag for operation if file exists
);
 
Parameters
lpExistingFileName 
Pointer to a null-terminated string that specifies the name of an existing file. 
lpNewFileName 
Pointer to a null-terminated string that specifies the name of the new file. 
bFailIfExists 
Specifies how this operation is to proceed if a file of the same name as that specified by lpNewFileName already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds. 
Return Values
If the function succeeds, the return value is nonzero.
 
Odgovor na temu

xeron
Sarajevo

Član broj: 25909
Poruke: 133
*.PPPoE-2702.sa.bih.net.ba.



Profil

icon Re: CopyFile() funkcija objasnjenje09.09.2006. u 22:52 - pre 214 meseci
a znacenje ovoga:

Code:

_argv[0]



... i hvala za odgovor !
if (argc > 1 && strcmp(argv[1], "-advice") == 0) {
printf("Don't Panic!n");
exit(42);
}
 
Odgovor na temu

Nibble

Član broj: 63173
Poruke: 302
*.dlp71.bih.net.ba.



+1 Profil

icon Re: CopyFile() funkcija objasnjenje10.09.2006. u 13:37 - pre 214 meseci
Kada kompajliras program i npr. ime tvog programa je test.exe, pozoves iz cmd.exe
Code:
test.exe C:\fajl.exe D:\NoviFajl.exe

u arg[0] ce se nalaziti "C:\fajl.exe" a u arg[1] ce biti "D:\Novifajl.exe" i tako...
 
Odgovor na temu

xeron
Sarajevo

Član broj: 25909
Poruke: 133
*.PPPoE-3918.sa.bih.net.ba.



Profil

icon Re: CopyFile() funkcija objasnjenje10.09.2006. u 14:26 - pre 214 meseci
ok, hvala puno na pomoci.
if (argc > 1 && strcmp(argv[1], "-advice") == 0) {
printf("Don't Panic!n");
exit(42);
}
 
Odgovor na temu

[es] :: C/C++ programiranje :: CopyFile() funkcija objasnjenje

[ Pregleda: 4104 | Odgovora: 4 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.