G+_Rud Dog Posted September 7, 2015 Share Posted September 7, 2015 Python 3 Windows 7, Creating a script which attempts to open files on my C drive and search for a keyword. Unfortunately when I come to this hwcompat.txt file it OSError: [Error22] since could not find any help from google decided to try it on my own but this is as far as I got. First thing was to try and open the file myself manually not using my script and I do get this: Reviewing the permissions I see these selections anyone know which one is causing the denied access. Also how does the edit button get that shield attached to it? BTW I duplicated the "SYSTEM" permission on another file but my script reported it existed and accessible.???? Link to comment Share on other sites More sharing options...
G+_Akira Yamanita Posted September 7, 2015 Share Posted September 7, 2015 Look at the permissions on the users group. You can probably list the file but can't read it. The shield on the edit button indicates that you have to elevate your privileges in order to edit the file. Link to comment Share on other sites More sharing options...
G+_Rud Dog Posted September 7, 2015 Author Share Posted September 7, 2015 It appears there is Read and Read and execute on group Link to comment Share on other sites More sharing options...
G+_Akira Yamanita Posted September 7, 2015 Share Posted September 7, 2015 I did a quick search and see that the folder is protected. Without referencing a Windows system, my guess is that there is a deny permission that's applied at one of the folders above or Windows itself regulates access. It's also possible that another program such as antivirus software is blocking access. Link to comment Share on other sites More sharing options...
G+_Rud Dog Posted September 7, 2015 Author Share Posted September 7, 2015 Thank you Akira Yamanita since that was one of two files causing the problem on my entire machine decided to bypass them and just not the name and path to each file. The part that confuses me is why would a text file be protected against access by the owner of the machine who btw is also the admin? Link to comment Share on other sites More sharing options...
G+_Jeff Brand Posted September 8, 2015 Share Posted September 8, 2015 UAC protects certain files and directories. Try running from command line as administrator? I believe there's a separation between an administrator who can elevate his permission and running with administrator permission continuously. The hosts file is a text file and definitely deserves protection. Link to comment Share on other sites More sharing options...
G+_Rud Dog Posted September 8, 2015 Author Share Posted September 8, 2015 Wait are you saying that is the host file? Link to comment Share on other sites More sharing options...
G+_Jeff Brand Posted September 8, 2015 Share Posted September 8, 2015 No, just an example of a text file that needs protection.. Link to comment Share on other sites More sharing options...
G+_Rud Dog Posted September 8, 2015 Author Share Posted September 8, 2015 Got it. Well now I can search my computer for text and doc files with keyword now to extend that search by incorporating come Regular Expressions. This this should be fun. Link to comment Share on other sites More sharing options...
G+_Jeff Brand Posted September 8, 2015 Share Posted September 8, 2015 Don't forget to implement the Boyer-Moore algorithm. ;) Link to comment Share on other sites More sharing options...
G+_Rud Dog Posted September 8, 2015 Author Share Posted September 8, 2015 Thank you Jeff Brand now I can google that one and figure out how and if I can use this algorithm. This is my return to programming after about 10 years of doing other things. Forget how much it was enjoyed. But now with the help of communities the steering for my ideas are keep on the right course. Again Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts