www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/03/11/13:31:27

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Thu, 11 Mar 2010 19:31:15 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: redirect-append (>>) creates garbage-y file
Message-ID: <20100311183115.GJ6505@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <01499D518A9B6F4493FC5A2D32F7A4FC51B52C97D4 AT MB-EXBX01 DOT north DOT pf DOT com> <1ef5a52f1003111000x17bd3716yb75d50a9f5db10 AT mail DOT gmail DOT com> <01499D518A9B6F4493FC5A2D32F7A4FC51B52C97D5 AT MB-EXBX01 DOT north DOT pf DOT com>
MIME-Version: 1.0
In-Reply-To: <01499D518A9B6F4493FC5A2D32F7A4FC51B52C97D5@MB-EXBX01.north.pf.com>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Mar 11 13:12, William Lebow wrote:
> echo foo | tee -a test3.txt : terminal output is okay but test3.text
> starts with 3 characters of garbage before the string foo
> 
> echo foo | tee test4.txt : terminal output is okay and test4.txt is okay too
> 
> So "tee -a" has the same issue as ">>" when creating a new file.
> 
> BTW, I believe that the garbage characters that precede the text is an encrypted
> version of the text in the file. This Credant software is protecting my txt files
> by encrypting them.

And it's doing something blatantly wrong.  Quite obviously, Cygwin
only writes the data once.  If it's in the file twice, once encrypted
and once unencrypted, then this Credant software does not understand
native NT writing with append mode(*).  You should report this as a bug.


Corinna

(*) http://msdn.microsoft.com/en-us/library/ms804364.aspx, see the
    ByteOffset description, last paragraph, the FILE_WRITE_TO_END_OF_FILE
    offset value.

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019