IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

C Discussion :

Permission sur un dossier


Sujet :

C

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Mai 2002
    Messages
    11
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2002
    Messages : 11
    Points : 9
    Points
    9
    Par défaut Permission sur 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

  2. #2
    Nouveau membre du Club
    Inscrit en
    Avril 2002
    Messages
    23
    Détails du profil
    Informations forums :
    Inscription : Avril 2002
    Messages : 23
    Points : 35
    Points
    35
    Par défaut
    Essaye de voir si stat fonctionne avec les dossiers :

    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);
    Pour te perfectionner en C, lis les tutoriels et cours pour apprendre le langage C : http://c.developpez.com/cours/

  3. #3
    fd
    fd est déconnecté
    Membre habitué
    Profil pro
    Inscrit en
    Mai 2002
    Messages
    131
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2002
    Messages : 131
    Points : 162
    Points
    162
    Par défaut fff
    Tu as les attributs avec :
    FindFirstFile()
    ou
    GetFileAttributesEx()

  4. #4
    Futur Membre du Club
    Profil pro
    Inscrit en
    Mai 2002
    Messages
    11
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2002
    Messages : 11
    Points : 9
    Points
    9
    Par défaut
    Merci pour les infos
    KURT

  5. #5
    Futur Membre du Club
    Profil pro
    Inscrit en
    Mai 2002
    Messages
    11
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2002
    Messages : 11
    Points : 9
    Points
    9
    Par défaut
    Est ce que tu pourrais me fournir le prototype de GetFileAttributesEx();
    je ne l'ai pas
    @+
    KURT

  6. #6
    fd
    fd est déconnecté
    Membre habitué
    Profil pro
    Inscrit en
    Mai 2002
    Messages
    131
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2002
    Messages : 131
    Points : 162
    Points
    162
    Par défaut voila
    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.

  7. #7
    Futur Membre du Club
    Profil pro
    Inscrit en
    Mai 2002
    Messages
    11
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2002
    Messages : 11
    Points : 9
    Points
    9
    Par défaut
    Merci
    KURT

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 2
    Dernier message: 27/10/2011, 19h31
  2. Réponses: 6
    Dernier message: 31/08/2010, 14h29
  3. Connaitre les permissions sur des dossiers ?
    Par tintin72 dans le forum Langage
    Réponses: 2
    Dernier message: 07/01/2009, 10h20
  4. "Permission denied" sur certains dossiers
    Par mikool19 dans le forum Apache
    Réponses: 3
    Dernier message: 31/10/2006, 13h57
  5. [Répertoire] permissions sur les dossiers crée
    Par kespy13 dans le forum Langage
    Réponses: 2
    Dernier message: 21/04/2006, 13h59

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo