Y a t'il une commande en C qui permet recuperer les permissions sur un dossier?
Ou de pouvoir determiner si on peut lire ou ouvrir un dossier?
@+
Y a t'il une commande en C qui permet recuperer les permissions sur un dossier?
Ou de pouvoir determiner si on peut lire ou ouvrir un dossier?
@+
KURT
Essaye de voir si stat fonctionne avec les dossiers :
Pour te perfectionner en C, lis les tutoriels et cours pour apprendre le langage C : http://c.developpez.com/cours/
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 #include <sys/types.h> #include <sys/stat.h> int stat(const char *path, struct stat *buf);
Tu as les attributs avec :
FindFirstFile()
ou
GetFileAttributesEx()
Est ce que tu pourrais me fournir le prototype de GetFileAttributesEx();
je ne l'ai pas![]()
@+
KURT
The GetFileAttributesEx function retrieves attributes for a specified file or directory.
BOOL GetFileAttributesEx(
LPCTSTR lpFileName, // file or directory name
GET_FILEEX_INFO_LEVELS fInfoLevelId, // attribute class
LPVOID lpFileInformation // attribute information
);
Parameters
lpFileName
[in] Pointer to a null-terminated string that specifies a file or directory.
Windows NT/2000/XP: In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to nearly 32,000 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see File Name Conventions.
Windows 98/Me: This string must not exceed MAX_PATH characters.
fInfoLevelId
[in] Specifies the class of attribute information to retrieve. This parameter can be one of the following values. Value Meaning
GetFileExInfoStandard The lpFileInformation parameter is a WIN32_FILE_ATTRIBUTE_DATA structure.
lpFileInformation
[out] Pointer to a buffer that receives the attribute information. The type of attribute information stored into this buffer is determined by the value of fInfoLevelId.
Return Values
If the function succeeds, the return value is a nonzero value.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager