From Greg.Snow at imail.org  Tue Oct 28 19:23:54 2008
From: Greg.Snow at imail.org (Greg Snow)
Date: Tue, 28 Oct 2008 12:23:54 -0600
Subject: [Rd] writting null (\000 or ^@) to an external text file without
 the new warning
Message-ID: <B37C0A15B8FB3C468B5BC7EBC7DA14CC6159B5E981@LP-EXMBVS10.CO.IHC.COM>

I have some functions that write an external text file for postprocessing by another program.  Some instructions to the other program need to be indicated by null values (\000 or ^@).  The function currently uses code like:

writeChar(rawToChar(as.raw(0)), con)

where con is a connection to the file.  Previous to version 2.8.0 this worked fine.  With 2.8.0 it still works, but I get a warning message about "truncating string with embedded null: '\0'" every time.  This is documented and not a bug, but I still find it annoying.

One thing I could do is to turn off all warnings before doing this, but then if there is some other warning generated, then I will miss the other warning(s).

Is there a better way to write the null to the text file? Or is there a way to suppress just this warning without suppressing any other warnings that may occur?

Thanks,

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111



[Rd] writting null (\000 or ^@) to an external text file without the new warning
Greg Snow