public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Earnie Boyd <earnie_boyd@yahoo.com>
To: cygwin users <cygwin@sourceware.cygnus.com>
Subject: Re: LF vs. CR/LF (WAS: Problems with libtiff!)
Date: Mon, 21 Jun 1999 07:22:00 -0000	[thread overview]
Message-ID: <19990621142924.23990.rocketmail@web116.yahoomail.com> (raw)

--- Ulrich Koehler <koehler@mvt.tu-clausthal.de> wrote:
> Hello,
> 
> first of all: thank you for your help!
> This RTFM! goes to me. I was not aware of the CR/LF
> problem and the differences between text and binary
> mode because I never browsed through the documentation.
> I did not even know that you can open files in text-mode,
> it sounds like a strange idea to me. Because I'm working
> on many platforms, I create and edit only text files with
> UNIX-style line-endings on Windows and I'm trying to keep
> my environment CR/LF-free.
> 

Welcome to the world of portable programming.

> Will I experience problems within the cygwin-environment,
> if I use only text=binary mounts?
> 

Yes.  If the script files contain \r\n line endings then bash and sh will
properly execute them.  Don't change to text=binary in order to become lazy.  I
always suggest that you leave it witht the text!=binary default.


> BTW:
> I've changed the single open() call in the libtiff-source to
> open the file as binary ( If I remember correctly the value
> O_BINARY is defined, I added '|0x100000' to the mode bits).
> It now seems to work now even with
> my default text!=binary mount. I could compile and link
> my application and used it without problems.

Good.

> I wrote 'it seems to work', because the 'thumbnail' binary
> still does not work. Maybe there is another reason why,
> 'tiff2ps' does work.

If it uses the fopen call you would use "rb" in the function instead of just
"r" to open in binary mode.  Unfortunately there isn't a "rt" equivalent for
text mode.  You can use though the setmode function to set either _O_BINARY or
_O_TEXT mode after the open call before reading/writing anything into the
buffer.

> I do not have the knowlegde to make a complete port using
> the configure script and I still want to be sure that I did
> the right thing.

I'm just learning the autoconf configure script language myself.  Shouldn't be
too difficult to learn.  Just start small and grow big.
===
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't include me)
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

WARNING: multiple messages have this Message-ID
From: Earnie Boyd <earnie_boyd@yahoo.com>
To: cygwin users <cygwin@sourceware.cygnus.com>
Subject: Re: LF vs. CR/LF (WAS: Problems with libtiff!)
Date: Wed, 30 Jun 1999 22:10:00 -0000	[thread overview]
Message-ID: <19990621142924.23990.rocketmail@web116.yahoomail.com> (raw)
Message-ID: <19990630221000.fUNC5OiyJUbDs7nqRpAYmXPd6ZFCX-fuJzGZt4lFoFw@z> (raw)

--- Ulrich Koehler <koehler@mvt.tu-clausthal.de> wrote:
> Hello,
> 
> first of all: thank you for your help!
> This RTFM! goes to me. I was not aware of the CR/LF
> problem and the differences between text and binary
> mode because I never browsed through the documentation.
> I did not even know that you can open files in text-mode,
> it sounds like a strange idea to me. Because I'm working
> on many platforms, I create and edit only text files with
> UNIX-style line-endings on Windows and I'm trying to keep
> my environment CR/LF-free.
> 

Welcome to the world of portable programming.

> Will I experience problems within the cygwin-environment,
> if I use only text=binary mounts?
> 

Yes.  If the script files contain \r\n line endings then bash and sh will
properly execute them.  Don't change to text=binary in order to become lazy.  I
always suggest that you leave it witht the text!=binary default.


> BTW:
> I've changed the single open() call in the libtiff-source to
> open the file as binary ( If I remember correctly the value
> O_BINARY is defined, I added '|0x100000' to the mode bits).
> It now seems to work now even with
> my default text!=binary mount. I could compile and link
> my application and used it without problems.

Good.

> I wrote 'it seems to work', because the 'thumbnail' binary
> still does not work. Maybe there is another reason why,
> 'tiff2ps' does work.

If it uses the fopen call you would use "rb" in the function instead of just
"r" to open in binary mode.  Unfortunately there isn't a "rt" equivalent for
text mode.  You can use though the setmode function to set either _O_BINARY or
_O_TEXT mode after the open call before reading/writing anything into the
buffer.

> I do not have the knowlegde to make a complete port using
> the configure script and I still want to be sure that I did
> the right thing.

I'm just learning the autoconf configure script language myself.  Shouldn't be
too difficult to learn.  Just start small and grow big.
===
Earnie Boyd < mailto:earnie_boyd@yahoo.com >

Newbies, please visit
< http://www.freeyellow.com/members5/gw32/index.html >

(If you respond to the list, then please don't include me)
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

             reply	other threads:[~1999-06-21  7:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-06-21  7:22 Earnie Boyd [this message]
1999-06-30 22:10 ` Earnie Boyd
  -- strict thread matches above, loose matches on Subject: below --
1999-06-30 22:10 Parker, Ron
1999-06-21  9:17 Earnie Boyd
1999-06-30 22:10 ` Earnie Boyd
1999-06-21  8:19 Peter Ring
1999-06-30 22:10 ` Peter Ring
1999-06-21  7:10 Earnie Boyd
1999-06-30 22:10 ` Earnie Boyd
1999-06-21  5:10 Demmer, Thomas
1999-06-30 22:10 ` Demmer, Thomas
1999-06-21  5:02 Ulrich Koehler
1999-06-30 22:10 ` Ulrich Koehler
1999-06-18 12:14 Parker, Ron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19990621142924.23990.rocketmail@web116.yahoomail.com \
    --to=earnie_boyd@yahoo.com \
    --cc=cygwin@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).