[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] creat-safer vs. text mode platforms

From: Joerg Schilling
Subject: Re: [Bug-tar] creat-safer vs. text mode platforms
Date: Fri, 17 Mar 2006 16:17:22 +0100
User-agent: nail 11.2 8/15/04

Eric Blake <address@hidden> wrote:

> Hash: SHA1
> On non-POSIX platforms like cygwin, where text mode can be distinct from
> binary mode, creat() will create a text-mode file.  But in tar, this is
> the wrong thing to do, since text mode corrupts the binary archive.
> Should we replace all uses of "creat (name, mode)" (such as in
> creat-safer.c) with "open (name, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY,
> mode)", with O_BINARY properly defined to 0 on POSIX systems?  This would
> make no difference in semantics to POSIX platforms, only where binary is
> distinct from text.

star does not use creat() and I believe application should not use creat()
if a three parameter open() is available.

Thank you for the hint!


 EMail:address@hidden (home) Jörg Schilling D-13353 Berlin
       address@hidden                (uni)  
       address@hidden     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily

reply via email to

[Prev in Thread] Current Thread [Next in Thread]