About the Tutorial



Download 2,85 Mb.
Pdf ko'rish
bet205/234
Sana28.05.2022
Hajmi2,85 Mb.
#614232
1   ...   201   202   203   204   205   206   207   208   ...   234
Bog'liq
python3 tutorial 060821094426

Description 
The method 
stat()
performs a stat system call on the given path. 
Syntax 
Following is the syntax for stat() method- 
os.stat(path) 
Parameters 
path
- This is the path, whose stat information is required. 
Return Value 
Here is the list of members of stat structure- 

st_mode: protection bits. 

st_ino: inode number. 

st_dev: device. 

st_nlink: number of hard links. 

st_uid: user id of owner. 

st_gid: group id of owner. 

st_size: size of file, in bytes. 

st_atime: time of most recent access. 

st_mtime: time of most recent content modification. 

st_ctime: time of most recent metadata change. 
Example 
The following example shows the usage of stat() method. 
# !/usr/bin/python3 
import os, sys 
# showing stat information of file "foo.txt" 
statinfo = os.stat('foo.txt') 


Python 3 
308 
print (statinfo) 
When we run the above program, it produces the following result- 
os.stat_result(st_mode=33206, 
st_ino=281474976797706, 
st_dev=1017554828, 
st_nlink=1, 
st_uid=0, 
st_gid=0, 
st_size=13, 
st_atime=1455649253, 
st_mtime=1438077266, st_ctime=1455560006) 
os.stat_float_times() Method 
Description 
The method stat_float_times() determines whether stat_result represents time stamps as 
float objects. 
Syntax 
Following is the syntax for stat_float_times() method- 
os.stat_float_times([newvalue]) 
Parameters 
newvalue
- If newvalue is True, future calls to stat() return floats, if it is False, future call 
on stat returns ints. If newvalue is not mentioned, it returns the current settings. 

Download 2,85 Mb.

Do'stlaringiz bilan baham:
1   ...   201   202   203   204   205   206   207   208   ...   234




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish