Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File change detection

Status
Not open for further replies.

Bangieff

Technical User
Feb 12, 2001
52
BG
Hi all
Can anyone tell me how may I untherstand immediatly when a file has been changed without looping?

thanks
 
use the stat command .

stat <filename>

u can use the ctime(member of stat ) to see whether the file has changed or not

regards
sramki
 
What I meaned was without looping...
If I use some of these methods I shoud do something like

while(1)
{
lstat(&quot;file.dat&quot;,filestat);
....
}

but I want to avoid this &quot;while&quot; loop....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top