I would like to see your code, if you have no objections.  I see in general terms how to script it, but I'm still enough of a php novice to benefit from real-world examples.


many thanks,

tim
  
No objections to this : there is the code
($idmol is your PDB id, the files are stored in 2 directories, one for gz (mol/gz) and one for pdb (mol/pdb)
The messages and comments are in french... I hope you could guess the meaning ;-)
ÂÂÂ ÂÂ
  //on copie le fichier compressà tÃlÃchargà à l'endroit voulu
ÂÂÂ ÂÂÂ $sourcePDB = fopen ("http://www.rcsb.org/pdb/cgi/export.cgi/".$idmol.".pdb.gz?format=PDB&pdbId=".$idmol."&compression=gz","rb");
ÂÂÂ ÂÂÂ
ÂÂÂ ÂÂÂ if (!$sourcePDB)
ÂÂÂ ÂÂÂ ÂÂÂ $message .= "Impossible de lire le fichier<br>\n";
ÂÂÂ ÂÂÂ else
ÂÂÂ ÂÂÂ {
ÂÂÂ ÂÂÂ ÂÂÂ $adresse["gz"] = "mol/gz/".$nomFichier.".pdb.gz";
ÂÂÂ ÂÂÂ ÂÂÂ $destination = fopen($adresse["gz"],"wb");
ÂÂÂ ÂÂÂ ÂÂÂ if (!$destination) {
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ $message .= "Impossible d'Ãcrire le fichier destination.<br>\n";
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ fclose($sourcePDB);
ÂÂÂ ÂÂÂ ÂÂÂ }
ÂÂÂ ÂÂÂ ÂÂÂ else
ÂÂÂ ÂÂÂ ÂÂÂ {
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ while (!feof ($sourcePDB)) {
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ $line = fread ($sourcePDB, 1024);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ fwrite($destination,$line);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ }
    $message .= "Transfert du fichier rÃalisà avec succÃs.<br>\n";
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ fclose($destination);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ fclose($sourcePDB);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ //on dÃcompresse le fichier tÃlÃchargÃ
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ $copieGZ = gzopen ($adresse["gz"],"rb");
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ if (!$copieGZ) {
     $message .= "Impossible de lire le fichier transfÃrà pour le dÃcompresser.<br>\n";
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ }
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ $adresse["pdb"] = "mol/pdb/".$nomFichier.".pdb";
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ $copiePDB = fopen($adresse["pdb"],"w");
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ while (!gzeof ($copieGZ)) {
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ $line = gzgets ($copieGZ, 1024);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ //echo $line;
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ fwrite($copiePDB,$line);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ }
    $message .= "Les versions compressÃes et non compressÃes du fichier ont Ãtà rÃalisÃes.<br>\n";
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ fclose($copiePDB);
ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ gzclose($copieGZ);ÂÂÂ ÂÂÂ ÂÂÂ ÂÂÂ
ÂÂÂ ÂÂÂ ÂÂÂ }

Paul
------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ Jmol-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to