Windows 10: Check for read permission on a file or directory using the C programming language

Discus and support Check for read permission on a file or directory using the C programming language in Windows 10 Software and Apps to solve the problem; I've written a library in C that currently only supports UNIX-like systems like Linux, and not Windows.I would like to add support for Windows, but I... Discussion in 'Windows 10 Software and Apps' started by James SELLARS 000743585, Feb 13, 2025.

  1. Check for read permission on a file or directory using the C programming language


    I've written a library in C that currently only supports UNIX-like systems like Linux, and not Windows.I would like to add support for Windows, but I NEED to check if a file or directory has read permission for whoever the user is that's running whatever is using my library. I've looked at several sites/forums including this one, I've tried looking at the Microsoft Learn site and am now totally confused as which Windows C API function/syscall to even use.I've tried using the _stat wrapper, but it still says that the file is readable, even when I remove read permission from it.My code:[code

    :)
     
    James SELLARS 000743585, Feb 13, 2025
    #1

  2. What programming language

    Hi,
    I kinda have a problem... I dont know which computer programming language to learn and stick with. Does anyone have any suggestions? I have done 2d programming with c++ and python and now want to move onto possibly 3d game programming. Which language should i use that has good 3d API's? I was thinking possibly C# with XNA gamestudio becuase my high school offers C# classes. Any suggestions?!*Smile Check for read permission on a file or directory using the C programming language :)

    Thanks!
     
    binsky3333, Feb 13, 2025
    #2
  3. Administartor rights lost in program file and program files x86

    Hi Luca,

    Thank you for posting in Microsoft Community, we appreciate your interest in Windows 10.

    I understand the inconvenience you are facing with accessing the files and folders on Program file and Program file x86, we will help you with this issue.

    Do let us know the following to assist you better:

    • Have you logged in as an administrator?
    • Is this issue specific only to the Programs file and Program file x86 folders?

    Step 1: If you have logged-in as an administrator, I suggest you to follow the below steps to give permission for entire system, so that you can access the specific files.

    • Right click on the folder and click on
      Properties
      .
    • Click on Security tab and select the
      group\user name.
    • Click on Edit option and check the option
      Full control.
    • Click on Apply and then on
      Ok
      button.

    Step 2: Try the following steps and check if it helps:

    • Right-click the C: Drive that you want to take ownership of, and then click
      Properties.
    • Click the Security tab, and then click
      OK on the Security message, if one appears.
    • Click Advanced, and then click the
      Owner tab.
    • In the Name list, click your user name,
      Administrator if you are logged in as Administrator, or click the
      Administrators group.

      If you want to take ownership of the contents of that folder, click to select the
      Replace owner on subcontainers and objects check box.
    • Click OK.

    • You may receive the following error message, where
      Folder is the name of the folder that you want to take ownership of:
      You do not have permission to read the co1ntents of directory Folder. Do you want to replace the directory permissions with permissions granting you Full Control? All permissions will be replaced if you press
      Yes.
    6. Click Yes.

    7. Click OK, and then reapply the permissions and security settings that you want for the folder and the folder contents.

    Hope it helps. Try the above and reply to the post with an updated status of this issue for further assistance, we will be happy to help you.
     
    Deepika Gowda, Feb 13, 2025
    #3
  4. Check for read permission on a file or directory using the C programming language

    Directory Size Utility

    Thanks buddy! Yea, this section's not dead. Kreij and I have big plans for this section. I don't want to give nothing away, but we have some bigger projects down the road. *Toast :toast: I feel I'm pretty good at coding with different languages, but I'm well behind Kreij's level of experience with those other Languages. I've been working on those other languages, and soon I'll feel comfortable enough to start, and not feel like I'm holding the project back. *Toast :toast:

    Now on to your suggestions.

    • maybe you rename Get Folder button caption to something more intuitive? Add Folder, Get Folder Size, Check Folder Size or something like that? Yea, that's been bothering me and I like your suggestion "Add Folder". I'll change it on the next release.
    • Could you add subfolder files to the right pane? (it can be a tickbox with include sub dirs) I could add this, but let me see if I understand what you're asking. By subfolders you mean add all the folders in the left panel to the right panel? Those folders are all the subfolders in the "Get folder".
    • maybe you also add export list to excel? I'll add this on the next release.
    • there's delete file button maybe you add delete folder button too? I'll add this on the next release.
    • and finally maybe you can add UP button for directories? I'll add this on the next release.
    These are all great suggestions! Thanks Drone! *Toast :toast:
     
    Mindweaver, Feb 13, 2025
    #4
Thema:

Check for read permission on a file or directory using the C programming language

Loading...
  1. Check for read permission on a file or directory using the C programming language - Similar Threads - Check read permission

  2. Check for read permission on a file or directory using the C programming language

    in Windows 10 Gaming
    Check for read permission on a file or directory using the C programming language: I've written a library in C that currently only supports UNIX-like systems like Linux, and not Windows.I would like to add support for Windows, but I NEED to check if a file or directory has read permission for whoever the user is that's running whatever is using my library....
  3. No Permission I cannot launch many softwares in directory "C:\Program Files\WindosApps"...

    in Windows 10 Gaming
    No Permission I cannot launch many softwares in directory "C:\Program Files\WindosApps"...: For example, if I try to launch WindowsTerminal or even Notepad, it turns out that I have no permission. If I use Adminstrator to log in the system, I can launch them.However, these software were installed by current user account but not Administrator when OS is Windows 10....
  4. No Permission I cannot launch many softwares in directory "C:\Program Files\WindosApps"...

    in Windows 10 Software and Apps
    No Permission I cannot launch many softwares in directory "C:\Program Files\WindosApps"...: For example, if I try to launch WindowsTerminal or even Notepad, it turns out that I have no permission. If I use Adminstrator to log in the system, I can launch them.However, these software were installed by current user account but not Administrator when OS is Windows 10....
  5. permission to C:\Program Files\WindowsApps\SubFolder

    in Windows 10 Network and Sharing
    permission to C:\Program Files\WindowsApps\SubFolder: Winodws 10 Pro Workgroup 1909 Need access to review the security rating at http://virustotal.com Trying to access file in C:\Program Files\WindowsApps\SubFolder Have tried both C:\Program Files\WindowsApps\A278AB0D.Asphalt9_2.5.300.2_x86__h6adky7gbf63m>takeown /f...
  6. permissions in c:/program files/ windowsapps/ have changed

    in Windows 10 Network and Sharing
    permissions in c:/program files/ windowsapps/ have changed: permissions in c:/program files/ windowsapps/ have changed and I can not change them error is Windows cannot access the specific device, path or file You may not have appropriate permissions to access them . most app's and all troubleshooters will not work, internet drops...
  7. C:\Program Files (x86)\... The file or directory is corrupted or unreadable

    in Windows 10 Network and Sharing
    C:\Program Files (x86)\... The file or directory is corrupted or unreadable: Every time I try to open anything on my computer it gives the same pop-up: The file or directory is corrupted or unreadable. Except for when I run as administrator. I am at a loss I feel I've tried everything this is basically last resort. Please Help!!...
  8. C:\Program Files (x86)\... The file or directory is corrupted or unreadable.

    in Windows 10 Network and Sharing
    C:\Program Files (x86)\... The file or directory is corrupted or unreadable.: Every time I try to open anything on my computer it gives the same pop-up: The file or directory is corrupted or unreadable. Except for when I run as administrator. I am at a loss I feel I've tried everything this is basically last resort. Please Help!!...
  9. Can not control permissions in C:/Program Files

    in User Accounts and Family Safety
    Can not control permissions in C:/Program Files: I am trying to install a plugin for Matlab, which is installed in C:/Program Files. I have done it on PCs running all OSs many times. A dialogue says I do not have permission. I go to the folder Program Files, right click, properties, security, advanced, click change...
  10. Can not control permissions in C:/Program Files

    in Windows 10 Support
    Can not control permissions in C:/Program Files: I am trying to install a plugin for Matlab, which is installed in C:/Program Files. I have done it on PCs running all OSs many times. A dialogue says I do not have permission. I go to the folder Program Files, right click, properties, security, advanced, click change...