System

From ArachneWiki

Jump to: navigation, search

The System module, in the system/ subdirectory of ARACHNE_DIR, contains useful macros and methods that mimic system calls. These methods are robust and provide a layer between Arachne and the system itself. System is commonly used throughout the Arachne code package, and if you write your own modules, it is a good idea to #include "System.h".

Methods include replacements for C++ open() and ifstream() and for the system calls system and cp.

One important subroutine is System::Cp, which, like the Unix cp command, copies files. System::Cp accounts for intermittent network failures through persistence: if the file copy fails, it will keep trying again after waiting for a while. The waits start at 10 seconds and continue to 5 minutes and 10 minutes. An unfortunate consequence of this is that if System::Cp is called with a non-existent source file, it will wait for several hours before failing. In this event, you will see output like the following in assemblez.log:

Error in copying file1 to file2.
copy failed, retrying in 10 seconds

Error in copying file1 to file2.
copy failed, retrying in 10 seconds

Error in copying file1 to file2.
copy failed, retrying in 10 seconds

Error in copying file1 to file2.
copy failed, retrying in 10 seconds

Error in copying file1 to file2.
copy failed, retrying in 5 minutes
Personal tools