PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > directory modification dates
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
directory modification dates

Réponse
 
LinkBack Outils de la discussion
Vieux 19/10/2007, 20h42   #1
Robert Cummings
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] directory modification dates

On Sat, 2007-10-20 at 01:36 +0300, Marek wrote:
> I have a simple directory listing script - you can move up and down
> directories and it shows the files/dirs inside. Now I have to figure out
> a way to display the latest modification time for each directory.
>
> The problem is that filemtime() works only if the modifications are done
> on the first level. For example, if I add files in dir1/dir2/dir3/, then
> the modification time for dir1 doesn't update.
>
> My first instinct was to find the correct time recursively on each load
> but there are so many files and so many visitors that it clogs the
> server. I have a few other ideas but they seem rather ugly (like hidden
> files with stored info in each directory).
>
> Can you suggest any better ways to approach this problem?


When a file is uploaded/changed ascend the directory tree and touch()
each of the directories.

http://ca.php.net/manual/en/function.touch.php

Cheers,
Rob.
--
.................................................. ..........
SwarmBuy.com - http://www.swarmbuy.com

Leveraging the buying power of the masses!
.................................................. ..........
  Réponse avec citation
Vieux 19/10/2007, 23h36   #2
Marek
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut directory modification dates

I have a simple directory listing script - you can move up and down
directories and it shows the files/dirs inside. Now I have to figure out
a way to display the latest modification time for each directory.

The problem is that filemtime() works only if the modifications are done
on the first level. For example, if I add files in dir1/dir2/dir3/, then
the modification time for dir1 doesn't update.

My first instinct was to find the correct time recursively on each load
but there are so many files and so many visitors that it clogs the
server. I have a few other ideas but they seem rather ugly (like hidden
files with stored info in each directory).

Can you suggest any better ways to approach this problem?

Marek
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h55.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08735 seconds with 10 queries