LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-12-2018, 06:04 AM   #1
suguprathap
LQ Newbie
 
Registered: Aug 2015
Posts: 4

Rep: Reputation: Disabled
access time change for directive


Hi,

i have a webserver document root as /var/www/html, inside that i have a folder called system. If i access the url http://test.system.com/system/hello.img in browser the access time of the file(hello.img) is changed but not the system folder. My requirement is when i access the file in a folder, the folder access time also has to be updated. I didn't find it in filesystem option. Your Help is much appreciated.

Regards,
Sugumar
 
Old 04-13-2018, 04:35 AM   #2
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,620
Blog Entries: 40

Rep: Reputation: Disabled
I may be erring and the effect of my suggestion may depend on the kind of server you are running.

But to do two things at the same time, i.e. serve (and touch) one file and at the same time touch the containing directory, you must concentrate both actions in 1 “command“. This calls for a programmed routine that your server must execute in lieu of simply serving the file.

I had hoped to find an automatism which can be triggered by the .htaccess file (apache-like web-servers) but this appears to be tricky, completely over my head, or downright impossible (all at once probably). Not fun, AFAIS.

Last edited by Michael Uplawski; 04-13-2018 at 04:37 AM. Reason: cosmetics
 
Old 04-13-2018, 02:02 PM   #3
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,723

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
On my system, the parent folder access time is updated when a file in the folder is created or changed. Simply reading a file does not affect the access time of the parent.

So, Michael Uplawski is on the right track...you may be able to effect what you want by touching or creating a file inside the system directory when the img file is retrieved...but like him, I'm not sure how you'd accomplish that upon request of a single file.

What is driving the requirement to see the access time of the containing folder changed?
Why are you looking at access times at all?
Have you looked into analyzing the log files to get what you need?

Last edited by scasey; 04-13-2018 at 10:26 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
access denied by directive chuchulain64 Linux - Server 1 08-27-2007 12:59 PM
Touch can't change access time activeco Linux - Software 2 05-22-2006 06:51 AM
Need ACCESS to change files! Every time I try to change a setting,"Permission Denied" Balarabay1 SUSE / openSUSE 2 03-06-2006 09:54 AM
Disable access to Time change yunus.raza Linux - Security 1 05-16-2005 12:10 PM
Change access time of files via c-program code 10gecko66 Linux - General 2 01-15-2004 09:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration