<commit_before>#region "   Copyright 2005-07 to <NAME> - http://www.devoo.net" 

// Errors, suggestions, contributions, send a mail to: <EMAIL>.

#endregion

using System.IO;
using System.Text;

namespace FileHelpers
{

#if NET_1_1 || MINI

	internal sealed class StreamHelper
	{
		private StreamHelper()
		{
		}

#else
	internal static class StreamHelper
	{
#endif
		internal static TextWriter CreateFileAppender(string fileName, Encoding encode, bool correctEnd)
		{
			return CreateFileAppender(fileName, encode, correctEnd, true);
		}

		internal static TextWriter CreateFileAppender(string fileName, Encoding encode, bool correctEnd, bool disposeStream)
		{
			TextWriter res;

			if (correctEnd)
			{
				FileStream fs = null;

				try
				{
					fs = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite);

					if (fs.Length >= 2)
					{
						fs.Seek(-2, SeekOrigin.End);

						if (fs.ReadByte() == 13)
						{
							if (fs.ReadByte() == 10)
							{
								int nowRead;
								do
								{
									fs.Seek(-2, SeekOrigin.Current);
									nowRead = fs.ReadByte();
								} while (nowRead == 13 || nowRead == 10);
							}
						}
						else
							fs.ReadByte();

						fs.WriteByte(13);
						fs.WriteByte(10);

					}

					res = new StreamWriter(fs, encode);

				}
				finally
				{
					if (disposeStream && fs != null)
						fs.Close();
				}
			}
			else
			{
				res = new StreamWriter(fileName, true, encode);
			}

			return res;
		}

	}
}<commit_msg>FIX: A problem in the PocketPc 2003 found and fixed by <NAME><commit_after>#region "   Copyright 2005-07 to <NAME> - http://www.devoo.net" 

// Errors, suggestions, contributions, send a mail to: <EMAIL>.

#endregion

using System.IO;
using System.Text;

namespace FileHelpers
{

#if NET_1_1 || MINI

	internal sealed class StreamHelper
	{
		private StreamHelper()
		{
		}

#else
	internal static class StreamHelper
	{
#endif
		internal static TextWriter CreateFileAppender(string fileName, Encoding encode, bool correctEnd)
		{
			return CreateFileAppender(fileName, encode, correctEnd, true);
		}

		internal static TextWriter CreateFileAppender(string fileName, Encoding encode, bool correctEnd, bool disposeStream)
		{
			TextWriter res;

			if (correctEnd)
			{
				FileStream fs = null;

				try
				{
					fs = new FileStream(fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite);

                    if (fs.Length >= 2)
                    {
#if MINI
                        fs.Seek(2, SeekOrigin.End);
#else
                        fs.Seek(-2, SeekOrigin.End);
#endif

                        if (fs.ReadByte() == 13)
                        {
                            if (fs.ReadByte() == 10)
                            {
                                int nowRead;
                                do
                                {
                                    fs.Seek(-2, SeekOrigin.Current);
                                    nowRead = fs.ReadByte();
                                } while (nowRead == 13 || nowRead == 10);
                            }
                        }
                        else
                            fs.ReadByte();

                        fs.WriteByte(13);
                        fs.WriteByte(10);
                    }

				    res = new StreamWriter(fs, encode);

				}
				finally
				{
					if (disposeStream && fs != null)
						fs.Close();
				}
			}
			else
			{
				res = new StreamWriter(fileName, true, encode);
			}

			return res;
		}

	}
}
{'fraction_non_alphanumeric': 0.09712425393380358, 'fraction_numerical': 0.013836136733586543, 'mean_word_length': 1.4320580474934037, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4133260', 'n_tokens_mistral': 1408, 'n_tokens_neox': 1062, 'n_words': 255}