Thank you very much.
I'll try to explain something more about my application.
The application is interfaced to a database containing
a lot of exercises and solutions. An exercise consists in
a description of the problem (a .ps file), an input file
(
exercise_code.in) and a
output file (
exercise_code.out). A solution
is called
correct iff,
provided (
exercise_code.in) as input, output
produced by the program equals
verbatim
(
exercise_code.out). If a solution is correct,
it will be inserted in the database. So a student can see
other solutions and learn. Or practice, in order to participate
to
ACM International Collegiate Programming Contest.
As you can see, the entire process is automatizable.
So far so good.
Here's a pseudo code description of my submit script.
get solution's source code from web form
get a valid temp file and store solution in it
# Here's my rudimental flocking system
while ( -e "exercise_code.in" ) {}
get from the database exercise_code.in and exercise_code.out
compile solution's source code (using gcc)
run the solution (it will produce executable_filename.out)
File::Compare executable_filename.out and exercise_code.out
if they are the same
insert solution in the database
else
wrong answer!
I feel I could do something better.
Now, I am going to examine your
Simple Locking code
See you