![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Файлы [D6, WinXP]
K7 © (2003-02-11 20:44:00)Есть файл ....
надо изменить дату и время его создания
как это зделать.
Palladin (2003-02-13 01:23:00) [1]FileSetDate(<имя файла>,DateTimeToFileDate(EncodeDate(<год>,<месяц>,<день>)));
К7 (2003-02-13 00:31:00) [2]SetFileTime
Выдает ошибку мол тип должен
быть PFileTime объясните по-
жалуйста с ней работать.
Или реальный пример.
Я ведь только начинаю познавать
мир програмирования и делфи поэ-
тому прошу ответить намой вопрос,
разобратся самому не получается.
Андрей Сенченко (2003-02-11 21:53:00) [3]Вообще то в таких случаях Helpохотно делится и тем и другим.
Алгоритм такой :
1. Жмем F1, Выбираем "разделы".
2. Набираем слово files
3. Обнаруживаем files, date-time routines, заходим поглядеть
видим :
The FileAge, FileGetDate, and FileSetDate routines operate on operating system date-time values. FileAge returns the date-and-time stamp of a file, or -1 if the file does not exist. FileSetDate sets the date-and-time stamp for a specified file, and returns zero on success or an error code on failure. FileGetDate returns a date-and-time stamp for the specified file or -1 if the handle is invalid.
As with most of the file manipulating routines, FileAge uses a string filename. FileGetDate and FileSetDate, however, take a Handle type as a parameter. To get access to a Windows file Handle either
Call the Windows API CreateFile function. CreateFile is a 32-bit only function that creates or opens a file and returns a Handle that can be used to access the file.
Instantiate TFileStream to create or open a file. Then use the Handle property as you would a Windows’ file Handle. See Using file streams for more information.
4. Вешаем на кнопочку например FileSetDate, ставим скобку и смотрим : что нас просят ввести ... АГА .. имя файла и новые дату-время
5. Собственно все. Как текущие дату-время в "естественном формате" перевести в TDateTime надеюсь найдете
Романов Р.В. (2003-02-11 21:39:00) [4]SetFileTime
К7 (2003-02-11 21:25:00) [5]Может кто нибудь поделится своими мыслями и знаниями ???????