help with reading ntfs permissions

This is the place for queries that don't fit in any of the other categories.

help with reading ntfs permissions

Postby tzuriely » Mon Dec 02, 2013 7:56 am

hi,
i am trying to build script that get ntfs permission from folder or files. i want to get the access list to specific file. after some briefing i understand i need to use "pywin32" library. but i cant find tutorial for how work with him or specific solution for my needs.
if someone can refer to tutorial or solution it will be great.
TNX all and i hope my topic is in the right place.
tzuriely
 
Posts: 1
Joined: Mon Dec 02, 2013 7:50 am

Re: help with reading ntfs permissions

Postby ochichinyezaboombwa » Wed Dec 04, 2013 4:52 am

I can only pity Windows users. How many almost unsolvable or unbelievably hard to solve 'problems' there are which... don't even exist on other OSs!
ochichinyezaboombwa
 
Posts: 200
Joined: Tue Jun 04, 2013 7:53 pm

Re: help with reading ntfs permissions

Postby metulburr » Wed Dec 04, 2013 4:56 am

not that this post helps the OP at all...
I can only pity Windows users. How many almost unsolvable or unbelievably hard to solve 'problems' there are which... don't even exist on other OSs!

+1

I get so frustrated when i jump to windows. I feel like i have to fight with the OS to what i want it to do.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1562
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: help with reading ntfs permissions

Postby Honduras2811 » Fri Dec 20, 2013 7:35 am

ochichinyezaboombwa wrote:I can only pity Windows users. How many almost unsolvable or unbelievably hard to solve 'problems' there are which... don't even exist on other OSs!


Walk a mile in the shoes of soeone trying to switch from Windoze to Linux. I installed Ubuntu 2 days ago and I'm lost, literally, in the file system. Specifically, though, I ran into a problem with Python and decided to use the 'help'. I am used to Windoze help, where the response is short, concise, and has nothing to do with the problem you are having.

So I finally figured out the syntax for the 'help' function (?) and was flabbergasted to get a response that was maybe 60 lines long, and probably answered any question that could possibly be asked about the import function. The problem is that Linux and Python are brand new to me, so the information I got might as well have been written in a foreign language. It was totally incomprehensible to me, so, it probably answered the question that I asked, but I really don't know. I read through it several times, even backwards once, and was still unable to recognize any information I could use to solve my problem.

*** Getting back to reality . . .
As to the original post, I recently needed a way to decipher windows file attributes, which I assume are similar to permissions. I didn't do the extended file attributes. In Windoze you use one of the 'GetAttr' functions to get the attributes of a file or directory. The return value is a Long Integer and can go higher than 30,000. For instance, a ReadOnly file will return a 1, a Compressed file returns 128, a file that is ReadOnly and Compressed returns 129.

Anyway, I created a VB6 Switch statement that can decode attribute return values up to about 300, I think. If it would do you any good I can post it. (Can't now because it's on one of my Windows hard drives)
AMD 4 Core CPU, UBUNTU 13.10, Python 2.7
Honduras2811
 
Posts: 6
Joined: Fri Dec 20, 2013 5:50 am
Location: Cabool, Missouri, USA

Re: help with reading ntfs permissions

Postby metulburr » Fri Dec 20, 2013 3:51 pm

Walk a mile in the shoes of soeone trying to switch from Windoze to Linux.

Almost everyone in linux has already done that. It is a learning curve. But if it wasn't worth it everyone would of migrated back to windows.

I installed Ubuntu 2 days ago and I'm lost, literally, in the file system.

For example: Windows has its executables, etc all in one directory set aside for that program. So everything would be in the path of something like C:/program files (x86)/Firefox/firefox.exe. Its libraries would also be somewhere nested or not in the directory Firefox, in the same path. However in linux, ALL executables for the user go into the directory /usr/bin, ALL libraries for the same executables go in /usr/lib.

The part i hate about windows is if i am looking for a certian library or executable, sometimes the program installed names their directory by the company name instead of the name of the program. However in linux, i know its executable is in /usr/bin, and its always names the program

IT looks like your just trying to get file permissions?
I have spend very little time in windows the past couple of years. So there could be a way to do the same. In your ubuntu, your most likey using the shell Bash, which comes with ubuntu. There would be no need really to write a script for linux to get permissions, because it is already in Bash. If you open up your ubuntu and insert:
Code: Select all
ls -l

it will give you a list of the directories and files and their permissions of the current directory you are in. To get a specific directory or file permission:
Code: Select all
ls -l <filename/directory>

If i am in windows, and need to know the file permissions, i just install cygwin, to get a unix environment in windows. and use ls -l in windows to get the same.

by the way the top 3 that are the easiest to move to linux (if your use to windows) is Ubuntu, Mint, and LInux Lite. The most like windows, is linux lite i think. Ubuntu is bloated, whereas linux lite can run on much older computers and faster, it also has more GUI buttons.

package installation is a lot easier as well. In windows you have to navigate to the website and download the program, install the program. In linux you can do that too, but you can also make it easier to install from repositories. In ubuntu, it would be:
Code: Select all
sudo apt-get search firefox

to search for firefox related repositiores. You can also grep this search to use regular expressions to refine the search even more. to install it, it would be:
Code: Select all
sudo apt-get install firefox

and at that point without errors you have firefox installed. It has shaved off so much time of searching for libraries or programs, where in linux it is just a simple command. For example, in Arch Linux AUR's minecraft and the latest mcpatcher is in the repos, so to install it in arch, is just a simple similar command, instead of naviagating searching for the latest mcpatcher, etc.

In linux, you can as well choose what desktop you want. If you dont want ubuntu's default Unity desktop (the bar on the left that looks like its for tablets or phones), you can install Xubuntu's desktop (xfce4) and when you log in switch to using that desktop. OR you can install gnome-session desktop. From there on, you are using Ubuntu OS, but with a different desktop. There are also (who knows, hundreds?) otons and tons of desktops to choose from.

OK im gonna stop, because i am getting way off topic
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1562
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY


Return to General Coding Help

Who is online

Users browsing this forum: Google [Bot] and 3 guests