I have a file that I compiled to an executable but when I attempt to run it with ./main, it says permission denied
. I used to have no problem executing files from this drive. I have deleted the file and recompiled it. If I run ls -la
I see that root owns it and it has executable permissions.
I attempt to run it with sudo ./main
and for some reason permission is still denied.
The partition is NTFS because I share it with my Windows partition.
I tried running a basic game executable that I made in Unity game engine. It ran with no issues. There only seems to be a problem with this file.
EDIT:
Thanks to one of the commenters for giving me this link: How do I use 'chmod' on an NTFS (or FAT32) partition? I added the exec option, and I was able to run my program. I did not check in with this problem earlier because it resolved itself temporarily for some unknown reason. It came back, so I was glad I had these responses to help me. Thanks!