Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
#!/usr/bin/python3
import os, sys
# Open a file
path = "d:\\python3\\foo.txt"
fd = os.open( path, os.O_RDWR|os.O_CREAT )
# Close opened file
os.close( fd )
# Now get the touple
info = os.lstat(path)
print ("File Info :", info)
# Now get uid of the file
print ("UID of the file :%d" % info.st_uid)
# Now get gid of the file
print ("GID of the file :%d" % info.st_gid)
Advertisements
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.
AcceptLearn more