Naviguation dans :  Perl  JavaScript  Détail  - load.cgi?Appel=saveAdmin
 présentée :  par cas d'appel   par traitements 
Retour à l'accueil
  
   
 Requêtes 

 load – Admin 

 Errer 

Requêtes de Ça-déménage.com
Accès professionnel
Fin en erreur de la requête
 
 
 Bibliothèque CaD 

 Fichiers 

 Log 

Bibliothèque de Ça-déménage.com
Accès aux fichiers
Fonctions de gestion des logs
 printLog | getLog 
 


 printLog  Ecriture de la log
Syntaxe printLog(cas,nom,val)
Paramètres 
nom  type  Description 
cas  IN Nom de la log
nom  IN Nom de la trace (format \w+)
val  IN Valeur de la trace (toute chaîne contenant une partie d'enregistrement valide)
retourne  OUT Taille de la log
Fonctions util. 
 Dir Chemins d'accès aux fichiers
 Trace Retourne l'enregistrement de trace du client (user agent)


Code Perl 

sub printLog {local($cas,$nom,$val) = @_; 
 local($nomFic,$x,$n); 
 $nomFic = $nomLog0.$cas."Num".$nomType;
 $x = "X";
 srand $$; until(open(F1,">>".$nomFic)) {select(undef,undef,undef,rand)}; print F1 $x; close(F1);
 $n = (-s $nomFic);
 $nomFic = $nomLog0.$cas."Id".$nomType;
 $x = &Trace($nom,$val);
 srand $$; until(open(F1,">>".$nomFic)) {select(undef,undef,undef,rand)}; print F1 $x; close(F1);
 return $n; return 0
}
Code JavaScript 

function printLog(cas,nom,val) { 
 var nomFic,x,n; 
 nomFic = nomLog0+cas+"Num"+nomType;
 x = "X";
 eval(nomFic+" += x"); 
 n = eval(nomFic).length; 
 nomFic = nomLog0+cas+"Id"+nomType;
 x = Trace(nom,val);
 eval(nomFic+" += x"); 
 return n; return 0
}