Changeset 13395 for trunk/gsdl/cgi-bin/gliserver.pl
- Timestamp:
- 2006-12-01T13:16:56+13:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/cgi-bin/gliserver.pl
r13385 r13395 189 189 if (-e $lock_file_name) { 190 190 # A lock file already exists... check if it's ours 191 my $lock_file_content = ""; 191 192 open(LOCK_FILE, "<$lock_file_name"); 192 my $lock_file_owner = <LOCK_FILE>; 193 while (<LOCK_FILE>) { 194 $lock_file_content .= $_; 195 } 193 196 close(LOCK_FILE); 197 198 # Pick out the owner of the lock file 199 $lock_file_content =~ /\<User\>(.*?)\<\/User\>/; 200 my $lock_file_owner = $1; 194 201 195 202 # The lock file is ours, so there is no problem … … 204 211 } 205 212 206 # Create a lock file for us and we're done 213 my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time); 214 my $current_time = sprintf("%02d/%02d/%d %02d:%02d:%02d", $mday, $mon + 1, $year + 1900, $hour, $min, $sec); 215 216 # Create a lock file for us (in the same format as the GLI) and we're done 207 217 open(LOCK_FILE, ">$lock_file_name"); 208 print LOCK_FILE "$username"; 218 print LOCK_FILE "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; 219 print LOCK_FILE "<LockFile>\n"; 220 print LOCK_FILE " <User>" . $username . "</User>\n"; 221 print LOCK_FILE " <Machine>(Remote)</Machine>\n"; 222 print LOCK_FILE " <Date>" . $current_time . "</Date>\n"; 223 print LOCK_FILE "</LockFile>\n"; 209 224 close(LOCK_FILE); 210 225 }
Note:
See TracChangeset
for help on using the changeset viewer.