<?php
// return a space delimited string containing names of suspended sessions
// (the instrumentDescriptor.xml files)

require("phpVars.php");


$dir=opendir($sessions_dir);
$dlist='';
$ltime=0; $latestName='n.a.';

while (!($filename= readdir($dir)) === FALSE) {
  if (!is_dir($sessions_dir . $filename)) {
     $apath=pathinfo($filename);
     $aext=$apath['extension'];
     $ttime=filectime($sessions_dir . $filename);
     if ($ttime > $ltime ) {
         $latestName=$apath['filename'];
         $ltime=$ttime;
     }
     if (strtoupper($aext)=='SUSPEND_XML') {
//       $dlist=$dlist.' '.$apath['filename'];
       $dlist=$dlist.' '.$filename;

     }
  }
}
closedir($dir);

header("Content-Type: text/plain");
print $dlist ;
?>