[Debian-med-packaging] Handling of /dev/null log file in Core Wrapper
Laszlo Kajan
lkajan at rostlab.org
Wed Sep 12 14:47:47 UTC 2012
Dear Vladimir!
I am using the Python Core Wrapper now with success. It is a great tool, thank you very much for providing it.
I have noticed that 0-size log files named like '<input-file>-parser.log' are generated and deleted during parsing. I would like to not create a
log file at all, and the only way I found (from Python) to do this is to give '/dev/null' as the log file, and apply this patch to the shared
library:
--- a/cif-parser/include/CifParserBase.h
+++ b/cif-parser/include/CifParserBase.h
@@ -73,7 +73,9 @@
** \param[in] fileName - relative or absolute name of the CIF file
** that is to be parsed.
** \param[in] parseLogFileName - relative or absolute name of the file
- ** where parsing log is to be stored.
+ ** where parsing log is to be stored. Defaults to
+ ** "<input-file>-parser.log" if left empty.
+ ** Use "/dev/null" to disable logging.
** \param[out] diagnostics - parsing result. If empty, parsing
** completed with no warnings or errors. If non-empty, there were
** parsing warnings and/or parsing errors.
--- a/cif-parser/src/CifParserBase.C
+++ b/cif-parser/src/CifParserBase.C
@@ -148,7 +148,7 @@
if (RcsbFile::IsEmpty(log))
{
log.close();
- RcsbFile::Delete(logFileName);
+ if( logFileName != "/dev/null" ) RcsbFile::Delete(logFileName);
}
else
{
As you see, I simply make it not attempt to remove /dev/null.
Best regards,
Laszlo Kajan
Rost Lab
Debian Maintainer
More information about the Debian-med-packaging
mailing list