SetFileTime_()

Vous débutez et vous avez besoin d'aide ? N'hésitez pas à poser vos questions
gansta93
Messages : 1448
Inscription : jeu. 26/févr./2004 11:17
Localisation : Le Village
Contact :

SetFileTime_()

Message par gansta93 »

Bonjour,

Est-ce que quelqu'un pourait m'expliquer comment marche cette fonction API svp?
En même temps, si je comprand bien, il me faudra un petit cour sur les structures... mais ça avec un exemple avec mon API ça devrait m'aider à comprendre :-).

Merci d'avance.
PS: Si quelqu'un peut me faire aussi pour GetFileTime_(), même si je pense que l'utilisation est la même, ça serait cool! :-)
nico
Messages : 3702
Inscription : ven. 13/févr./2004 0:57

Message par nico »

Il y a déjà plusieurs post sur le sujet, fait une recherche sur GetFileTime.
gansta93
Messages : 1448
Inscription : jeu. 26/févr./2004 11:17
Localisation : Le Village
Contact :

Message par gansta93 »

nico a écrit :Il y a déjà plusieurs post sur le sujet, fait une recherche sur GetFileTime.
C'est à croire que les recherches avec les mêmes mots ne marchent pas pour tout le monde ;-).
Anonyme2
Messages : 3518
Inscription : jeu. 22/janv./2004 14:31
Localisation : Sourans

Message par Anonyme2 »

Tu vas sur le site des code fr (regarde un post du soldat inconnu, le lien est en bas du post) dans la rubrique fichiers/dossiers et ouvre l'exemple Filetime, y a tout quesqui faut sur getfiletime pour pas mourir idiot :jesors:
gansta93
Messages : 1448
Inscription : jeu. 26/févr./2004 11:17
Localisation : Le Village
Contact :

Message par gansta93 »

Et pour SetFileTime,, c'est la même chose?
Anonyme2
Messages : 3518
Inscription : jeu. 22/janv./2004 14:31
Localisation : Sourans

Message par Anonyme2 »

Tu as la doc microsoft sur les API ?

Car pour commencer, il faut lire la doc MS sur l'API voulu et seulement après essayer de la programmer.

C'est pratiquement la même chose sachant que d'après la doc, il y a des limitations en fonction des OS
SetFileTime

The SetFileTime function sets the date and time that a file was created, last accessed, or last modified.


BOOL SetFileTime(
HANDLE hFile,
const FILETIME* lpCreationTime,
const FILETIME* lpLastAccessTime,
const FILETIME* lpLastWriteTime
);

Parameters
hFile
[in] Handle to the file for which to set the dates and times. The file handle must have been created with the FILE_WRITE_ATTRIBUTES access right. For more information, see File Security and Access Rights.
lpCreationTime
[in] Pointer to a FILETIME structure that contains the date and time the file was created. This parameter can be NULL if the application does not need to set this information.
lpLastAccessTime
[in] Pointer to a FILETIME structure that contains the date and time the file was last accessed. The last access time includes the last time the file was written to, read from, or (in the case of executable files) run. This parameter can be NULL if the application does not need to set this information.
lpLastWriteTime
[in] Pointer to a FILETIME structure that contains the date and time the file was last written to. This parameter can be NULL if the application does not want to set this information.
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
Not all file systems can record creation and last access time and not all file systems record them in the same manner. For example, on Windows NT FAT, create time has a resolution of 10 milliseconds, write time has a resolution of 2 seconds, and access time has a resolution of 1 day (really, the access date). On NTFS, access time has a resolution of 1 hour. Therefore, the GetFileTime function may not return the same file time information set using SetFileTime. Furthermore, FAT records times on disk in local time. However, NTFS records times on disk in UTC. For more information, see File Times.
gansta93
Messages : 1448
Inscription : jeu. 26/févr./2004 11:17
Localisation : Le Village
Contact :

Message par gansta93 »

Arf... chaud.
Anonyme2
Messages : 3518
Inscription : jeu. 22/janv./2004 14:31
Localisation : Sourans

Message par Anonyme2 »

tu n'aimes pas la langue anglaise ? :mrgreen:

Si t'as des problèmes avec ces API poste tes codes et on verra ce qui cloche.
Répondre