473,410 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Why no change in fileatime?

When I write to a file, the fileatime does not update - how can I get the
mod date to update when writing to the file?

//increment counter value by 1
$counter=file($ctr);
$oldct=each($counter);
$newct=$oldct[value]+1;
//write new value to viscounter file
$fp=fopen($ctr, "w");
if (flock($fp, LOCK_EX))
{
fwrite($fp, $newct);
flock($fp, LOCK_UN);
}
//if cd not get lock, don't count this hit
fclose($fp);
echo "counter = ".$newct." visit at ".fileatime($ctr);
// fileatime($ctr) stays the same...
Jul 17 '05 #1
2 1644
On Wed, 14 Jul 2004 15:33:04 GMT, "deko" <no****@hotmail.com> wrote:
When I write to a file, the fileatime does not update


http://uk2.php.net/fileatime

--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk / http://www.andyhsoftware.co.uk/space
Jul 17 '05 #2
Try flushing the stat cache-- clearstatcache()

"deko" <no****@hotmail.com> wrote in message
news:Qm******************@newssvr25.news.prodigy.c om...
When I write to a file, the fileatime does not update - how can I get the
mod date to update when writing to the file?

//increment counter value by 1
$counter=file($ctr);
$oldct=each($counter);
$newct=$oldct[value]+1;
//write new value to viscounter file
$fp=fopen($ctr, "w");
if (flock($fp, LOCK_EX))
{
fwrite($fp, $newct);
flock($fp, LOCK_UN);
}
//if cd not get lock, don't count this hit
fclose($fp);
echo "counter = ".$newct." visit at ".fileatime($ctr);
// fileatime($ctr) stays the same...

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Ben | last post by:
Hi all, I have a following function in an external file: <?php function counter($hostaddr,$fname) { $currentfile="/".$hostaddr.$fname; echo $currentfile; if (file_exists($currentfile)) {...
4
by: J.C. Flores | last post by:
Hello all, First of all, I must state that I'm new to SQL Server, but have been a long-time software guy for quite some time. Please excuse the potential simplicity of the solution to my...
1
by: Spike | last post by:
Hello! Im going to make a javascript for changing alot of images. But im not sure how to do it., where to start.. Ok, first.. this is the isue. I have 3 images(I call them 1a-3a). when u...
0
by: beanweed | last post by:
BACKGROUND ---------- I have an ASP.NET application having two panels. In one panel, an XML document, transformed using xsl, is displayed. In the other panel are some controls that allow a user...
5
by: Hank | last post by:
My Access 2000 code has been running for several years in our main plant. Now we need to install it, as a stand-along application, at remote sites, some of which are out of state. My problem is...
10
by: Fabrizio | last post by:
(Sorry for the crosspost, but I really don't know which is the right newsgroup!) Hi all, I try to change the password to a user that as to change the password at first logon: try {
4
by: active | last post by:
It appears to me that if I change the Control's client size the controls size does not change to agree with the new size. Does it work like the VB6 ScaleWidth and ScaleHeight? That is after I...
11
by: Simon | last post by:
Dear reader, The syntax for the VBA code to change the RowSource of a Master Report is: Me.RowSource = "TableOrQueryName"
1
by: monkey1001 | last post by:
my program is suppose to show my due change and i got it working but my change and coins are wrong how can i improve it thank you..(its supposed to be in java)
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.