Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9153365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:15:39+00:00 2026-06-17T12:15:39+00:00

I want to get when the file accessed last time, I tried following code:

  • 0

I want to get when the file accessed last time, I tried following code:

import os, time

os.system("python test.py")
print os.stat('test.py').st_atime

time.sleep(60)

os.system("python test.py")
print os.stat('test.py').st_atime

But each time the output is same as follows :

1358489344.72
1358489344.72

I was expecting a difference in output before delay and after delay.
also output is same wen I run the code every time.

what could be wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T12:15:40+00:00Added an answer on June 17, 2026 at 12:15 pm

    The field st_atime is changed by file accesses, for example, by execve(2), mknod(2), pipe(2), utime(2) and read(2) (of more than zero bytes). Other routines, like mmap(2), may or may not update st_atime.

    While you run “python test.py”, it won’t call read(2), instead it would call mmap(2). That’s why the access time didn’t be udpated.

    Here is output of “strace python test.py”

    open("test.py", O_RDONLY)               = 3
    fstat(3, {st_mode=S_IFREG|0644, st_size=36, ...}) = 0
    mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ad626cdd000
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get values under specific tags of my xml file (accessed via
I am trying to read file headers using java, I want to get file
I want to get the file names of all files that have a specific
I want to get the file extension of uploaded file in Marklogic server. I
I want to get the file name without the file extension in Vim. I
I have a Html form. I want to get the file containing posted form's
i want query a file xml with linq, i want get all descendat of
I want to get the fullname from a file on Silverlight OpenFileDialog, when I
I want to get the type of file uploaded using the ASP.NET FileUpload control.
I want to get the %tagname% from a file and copy them to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.