CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Posts
    4

    Is directory writeable?

    Hi,

    Under unix, it is a very simple matter to see if a user can create files in a directory - just check the permissions.

    Is there an equivalent function for Win95/NT? Right now, I am creating a temp file in the directory and, if successful - deleting it and returning TRUE. However, it seems to me that there must be an easier way than this!

    Any ideas?




  2. #2
    Join Date
    Apr 1999
    Posts
    14

    Re: Is directory writeable?

    CreateFileEx() ?


  3. #3
    Join Date
    May 1999
    Posts
    4

    Re: Is directory writeable?

    Hi Jerome,

    I have searched all the WINAPI and MFC headers, and I can't find any reference to CreateFileEx.
    Is it in some other library you have? Or is it wishful thinking (Gosh, wouldn't it be great if there was a CreateFileEx function that could....)?


    Regards,
    Dan Gill




  4. #4
    Join Date
    Apr 1999
    Location
    Huntsville, Al
    Posts
    27

    Re: Is directory writeable?

    You can use GetFileAttributes to check if a file or directory is read-only (and other info)

    Also look at GetFileSecurity


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured