28.10.2021 Views

Python Tutorial ( PDFDrive )

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• 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/python

import os, sys

# showing stat information of file "a2.py"

statinfo = os.stat('a2.py')

print statinfo

Let us compile and run the above program, this will produce the following result:

posix.stat_result(st_mode=33188, st_ino=3940649674337682L, st_dev=277923425L, st

_nlink=1, st_uid=400, st_gid=401, st_size=335L, st_atime=1330498089, st_mtime=13

30498089, st_ctime=1330498089)

os.stat_float_times([newvalue])

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 calls return ints. If

newvalue is not mentioned, it returns the current settings.

Return Value

This method returns true or false.

Example

The following example shows the usage of stat_float_times() method.

# !/usr/bin/python

import os, sys

TUTORIALS POINT

Simply Easy Learning

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!