Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2004.08.29;
Скачать: [xml.tar.bz2];

Вниз

CopyFiles   Найти похожие ветки 

 
Nata   (2004-08-12 17:24) [0]

Здраствуйте мастера...я использую copyfile(с:\1.txt,d:\1.txt,true) но выяснилось что если такой файл есть 1.txt то copyfile его не перезаписывает...а мне надо что бы он перезаписывал....подскажите плз...

P.S.знаю знаю вопрос детский...без хи хи -ха ха плз...!


 
s999   (2004-08-12 17:27) [1]

А третий параметр в CopyFile для чего?


 
Nata   (2004-08-12 17:29) [2]

подозреваю что в нем то как раз и дело...;)
я навожу на copyfile нажимаю ф1 и не находит он описание....:(


 
jack128 ©   (2004-08-12 17:34) [3]


> я навожу на copyfile нажимаю ф1 и не находит он описание
Есть в IDE замечательный пункт меню - "Help" называется. А в нем не менее замечательный подпункт "Windows SDK" - попробуй там поискать - думаю результаты тебя порадуют ;-)


 
Nata   (2004-08-12 17:37) [4]


> jack128 ©   (12.08.04 17:34) [3]

вау круто пасибо...
я так поняла мне надо
COPYFLG_NOVERSIONCHECK
Ignore file versions and write over existing files in the destination directory.
да?


 
begin...end ©   (2004-08-12 17:37) [5]


> Nata

Поскольку третий параметр имеет тип Boolean, нетрудно догадаться, какое значение, кроме True (как в [0]) он может принимать.


 
Nata   (2004-08-12 17:40) [6]


> begin...end ©

твоя правда!....;)
т.е надо поставить false???? а что тогда значит это:
Optional. These flags can be used to control how files are copied. You must specify the actual numerical value in the INF file.

COPYFLG_WARN_IF_SKIP  (0x00000001)

Display a warning if the user tries to skip a file after an error has occurred.

COPYFLG_NOSKIP  (0x00000002)

Do not allow the user to skip copying the file.

COPYFLG_NOVERSIONCHECK  (0x00000004)

Ignore file versions and write over existing files in the destination directory.

COPYFLG_FORCE_FILE_IN_USE  (0x00000008)

Force file-in-use behavior.  Handle the file as if it was in use during the file copying operation.

COPYFLG_NO_OVERWRITE  (0x00000010)

Do not overwrite an existing file in the destination directory.

COPYFLG_NO_VERSION_DIALOG  (0x00000020)

Do not overwrite a file in the destination directory if the existing file is newer than the source file.

COPYFLG_REPLACEONLY  (0x00000040)

Copy the source file to the destination directory only if the file is already present in the destination directory.


 
begin...end ©   (2004-08-12 17:42) [7]


> [6] Nata   (12.08.04 17:40)


> а что тогда значит это:

Это значит, что ты залезла не в тот раздел справки.


 
jack128 ©   (2004-08-12 17:43) [8]


> Nata   (12.08.04 17:40

хе. А где ты все это откопала то?


 
s999   (2004-08-12 17:59) [9]

Бедная девушка набрала Copy, и увидив "Copy Files" попала... в топик из "INF File Format Reference" :)))


 
OSokin ©   (2004-08-12 19:36) [10]

Сначала файл удали...


 
Хакер_1   (2004-08-12 20:37) [11]

SetFileAttributes("d:\1.txt",FILE_ATTRIBUTE_NORMAL );
DeleteFile("d:\1.txt");
copyfile("с:\1.txt","d:\1.txt",false);
во как !


 
Anatoly Podgoretsky ©   (2004-08-12 21:02) [12]

Nata   (12.08.04 17:29) [2]
Да ладно, у него же всего два значения, можно проверить и без справки.


 
TUser ©   (2004-08-12 21:48) [13]

Вот у меня апрвильный SDK есть
The CopyFile function copies an existing file to a new file.

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

Points to a null-terminated string that specifies the name of an existing file.

lpNewFileName

Points 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.
If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

Security attributes for the existing file are not copied to the new file.
File attributes (FILE_ATTRIBUTE_*) for the existing file are copied to the new file. For example, if an existing file has the FILE_ATTRIBUTE_READONLY file attribute, a copy created through a call to CopyFile will also have the FILE_ATTRIBUTE_READONLY file attribute. For further information on file attributes, see CreateFile.

See Also

CreateFile, MoveFile

И, кажется, первый и второй параметры ты местами перепутала.



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2004.08.29;
Скачать: [xml.tar.bz2];

Наверх




Память: 0.47 MB
Время: 0.057 c
14-1092175333
-=Iton=-
2004-08-11 02:02
2004.08.29
Толкиенисты в Киеве


3-1091520467
Rostislav Rotaru
2004-08-03 12:07
2004.08.29
быстрая вставка записей


1-1092196174
maxkat
2004-08-11 07:49
2004.08.29
глобальные переменные!


14-1092044143
Серж
2004-08-09 13:35
2004.08.29
Как склеить 2 exe-шника?


3-1091591198
mixam
2004-08-04 07:46
2004.08.29
bde





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский