public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* setmode (long)
@ 1999-02-24  0:31 E. Robert Tisdale
       [not found] ` < 36D39A03.89B3C703@netwood.net >
  1999-02-28 23:02 ` E. Robert Tisdale
  0 siblings, 2 replies; 28+ messages in thread
From: E. Robert Tisdale @ 1999-02-24  0:31 UTC (permalink / raw)
  To: cygwin

I have written an application in C++ which is supposed to compile
and run on any platform including UNIX, DOS and Windows 95/98/NT.
It reads and writes text as well as binary data from files and
standard input and output.  It uses the line feed (newline) character
to mark the end of a line and the carriage return line feed sequence
to mark the end of a paragraph.  It reads and writes text files
in binary mode and converts \r\n to \n on input and \n to \r\n
on output for DOS (and Windows 95/98/NT) systems so that the user
can read, edit and print them using native tools.

On DOS and Windows 95/98/NT systems, the C preprocessor includes code
which uses setmode to change the default I/O mode from text to binary.
This worked just fine with older versions of DJGPP on DOS
but I have just downloaded and installed the most recent versions
of DJGPP, Cygwin and mingw32 and I am experiencing some problems.
I wrote a short program, `test.cc', to help illustrate them.
----------------------------------------------------------------------

// test.cc

#include<fstream.h>
#include<io.h>
#include<fcntl.h>

int
main() {
  int   oldmode = 0;
  cout << "default mode:\n";
  cout << "  0 carriage returns\n";
  cout << "  1 carriage returns\r\n";
  cout << "  2 carriage returns\r\r\n";
  cout << "  3 carriage returns\r\r\r\n";
  oldmode = setmode(1, O_TEXT);
  cout << hex << oldmode <<
    " = setmode(1, " << hex << O_TEXT   << "):\n";
  cout << "  0 carriage returns\n";
  cout << "  1 carriage returns\r\n";
  cout << "  2 carriage returns\r\r\n";
  cout << "  3 carriage returns\r\r\r\n";
  oldmode = setmode(1, O_BINARY);
  cout << hex << oldmode <<
    " = setmode(1, " << hex << O_BINARY << "):\n";
  cout << "  0 carriage returns\n";
  cout << "  1 carriage returns\r\n";
  cout << "  2 carriage returns\r\r\n";
  cout << "  3 carriage returns\r\r\r\n";
  oldmode = setmode(1, O_TEXT);
  cout << hex << oldmode <<
    " = setmode(1, " << hex << O_TEXT   << "):\n";
  cout << "  0 carriage returns\n";
  cout << "  1 carriage returns\r\n";
  cout << "  2 carriage returns\r\r\n";
  cout << "  3 carriage returns\r\r\r\n";

  ofstream      test_out("test.out", ios::out);
  test_out << "default mode:\n";
  test_out << "  0 carriage returns\n";
  test_out << "  1 carriage returns\r\n";
  test_out << "  2 carriage returns\r\r\n";
  test_out << "  3 carriage returns\r\r\r\n";
  oldmode = setmode((test_out.rdbuf())->fd(), O_TEXT);
  test_out << hex << oldmode <<
    " = setmode((test_out.rdbuf())->fd(), " << hex << O_TEXT   << "):\n";
  test_out << "  0 carriage returns\n";
  test_out << "  1 carriage returns\r\n";
  test_out << "  2 carriage returns\r\r\n";
  test_out << "  3 carriage returns\r\r\r\n";
  oldmode = setmode((test_out.rdbuf())->fd(), O_BINARY);
  test_out << hex << oldmode <<
    " = setmode((test_out.rdbuf())->fd(), " << hex << O_BINARY << "):\n";
  test_out << "  0 carriage returns\n";
  test_out << "  1 carriage returns\r\n";
  test_out << "  2 carriage returns\r\r\n";
  test_out << "  3 carriage returns\r\r\r\n";
  oldmode = setmode((test_out.rdbuf())->fd(), O_TEXT);
  test_out << hex << oldmode <<
    " = setmode((test_out.rdbuf())->fd(), " << hex << O_TEXT   << "):\n";
  test_out << "  0 carriage returns\n";
  test_out << "  1 carriage returns\r\n";
  test_out << "  2 carriage returns\r\r\n";
  test_out << "  3 carriage returns\r\r\r\n";
  return 0;
  }
----------------------------------------------------------------------

I compiled under Windows 98 using DJGPP and a DOS shell (MS-DOS Prompt)

        >gxx -v -w -O2 -o test test.cc -lgpp

and I ran the test program

        >.\test > test.dos

I started a Cygwin-b20 bash shell and examined the results:

        $ vi test.dos
        default mode:^M
          0 carriage returns^M
          1 carriage returns^M^M
          2 carriage returns^M^M^M
          3 carriage returns^M^M^M^M
        8 = setmode(1, 8):^M
          0 carriage returns^M
          1 carriage returns^M^M
          2 carriage returns^M^M^M
          3 carriage returns^M^M^M^M
        8 = setmode(1, 4):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        4 = setmode(1, 8):^M
          0 carriage returns^M
          1 carriage returns^M^M
          2 carriage returns^M^M^M
          3 carriage returns^M^M^M^M

appears to be correct but

        $ vi test.out
        default mode:
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        8 = setmode((test_out.rdbuf())->fd(), 8):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        8 = setmode((test_out.rdbuf())->fd(), 4):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        4 = setmode((test_out.rdbuf())->fd(), 8):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M

shows that test.out was opened in binary mode
and setmode didn't switch to text mode.

----------------------------------------------------------------------

I compiled under Windows 98 using EGCS Cygwin-b20 and a bash shell

        $ g++ -v -Wall -O2 -o test test.cc

ran the test program

        $ ./test > test.cyg

and examined the results:

        $ vi test.cyg
        default mode:^M
          0 carriage returns^M
          1 carriage returns^M^M
          2 carriage returns^M^M^M
          3 carriage returns^M^M^M^M
        20000 = setmode(1, 20000):^M
          0 carriage returns^M
          1 carriage returns^M^M
          2 carriage returns^M^M^M
          3 carriage returns^M^M^M^M
        20000 = setmode(1, 10000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        10000 = setmode(1, 20000):^M
          0 carriage returns^M
          1 carriage returns^M^M
          2 carriage returns^M^M^M
          3 carriage returns^M^M^M^M

appears to be correct but

        $ vi test.out
        default mode:
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        20000 = setmode((test_out.rdbuf())->fd(), 20000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        20000 = setmode((test_out.rdbuf())->fd(), 10000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        10000 = setmode((test_out.rdbuf())->fd(), 20000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M

shows that test.out was opened in binary mode
and setmode didn't switch to text mode.

----------------------------------------------------------------------

I re-compiled under Windows 98 using EGCS Cygwin-b20 with mingw32

        $ g++ -L/mingw32/lib -L/mingw32/i386-mingw32/lib \
        -L/mingw32/lib/gcc-lib/i386-mingw32/egcs-2.91.60 \
        -v -Wall -O2 -mno-cygwin -o test test.cc -lstdc++ -liberty

and ran the test program using and a DOS shell (MS-DOS Prompt)

        >.\test > test.win

I used the Cygwin-b20 bash shell to examine the results:

        $ vi test.win
        default mode:
          0 carriage returns
          1 carriage returns
          2 carriage returns
          3 carriage returns
        4000 = setmode(1, 4000):
          0 carriage returns
          1 carriage returns
          2 carriage returns
          3 carriage returns
        4000 = setmode(1, 8000):
          0 carriage returns
          1 carriage returns
          2 carriage returns
          3 carriage returns
        8000 = setmode(1, 4000):
          0 carriage returns
          1 carriage returns
          2 carriage returns
          3 carriage returns

contains no carriage returns and

       $ vi test.out
        default mode:
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        4000 = setmode((test_out.rdbuf())->fd(), 4000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        4000 = setmode((test_out.rdbuf())->fd(), 8000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        8000 = setmode((test_out.rdbuf())->fd(), 4000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M

shows that test.out was opened in binary mode
and setmode didn't switch to text mode.

----------------------------------------------------------------------

I didn't change any of the default settings when I installed Cygwin.
I didn't mount any file systems as binary only or define binmode.
I've read the FAQs and searched the mailing list archives.

It appears to me that there are still very serious problems
with text and binary I/O in DJGPP, Cygwin-b20 and mingw32
using Cygwin-b20 bash and MS-DOS Prompt under Windows 98.

Also, all the information regarding text and binary I/O
seems to be scattered across many different documents.
I think it would help me and other portable application
programmers if someone could put it all together
in one place with expicit references to the specific
operating system, compiler and shell to which it applies.

Thanks in advance, E. Robert Tisdale <edwin@netwood.net>

NOTE:   My editor, `vi', displays a carriage return as ^M
        but the line feed at the end of the line is invisible.
        My DOS shell is C:\WINDOWS\COMMAND.COM



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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
       [not found] ` < 36D39A03.89B3C703@netwood.net >
@ 1999-02-24 11:42   ` Christopher Faylor
  1999-02-25  1:26     ` E. Robert Tisdale
  1999-02-28 23:02     ` Christopher Faylor
  0 siblings, 2 replies; 28+ messages in thread
From: Christopher Faylor @ 1999-02-24 11:42 UTC (permalink / raw)
  To: E. Robert Tisdale; +Cc: cygwin

On Tue, Feb 23, 1999 at 10:19:47PM -0800, E. Robert Tisdale wrote:
>...shows that test.out was opened in binary mode
>and setmode didn't switch to text mode.

That's right in older Cygwin's setting the mode to TEXT didn't
necessarily change the mode.  This should be fixed in the
snapshots.

We have gone around and around on this behavior in the developers
list but I think that the current implementation is correct.

cgf

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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
  1999-02-24 11:42   ` Christopher Faylor
@ 1999-02-25  1:26     ` E. Robert Tisdale
       [not found]       ` < 36D51691.6E1579DF@netwood.net >
                         ` (2 more replies)
  1999-02-28 23:02     ` Christopher Faylor
  1 sibling, 3 replies; 28+ messages in thread
From: E. Robert Tisdale @ 1999-02-25  1:26 UTC (permalink / raw)
  To: cygwin

Christopher Faylor wrote:

> That's right in older Cygwin's
> setting the mode to TEXT didn't necessarily change the mode.
> This should be fixed in the snapshots.
>
> We have gone around and around on this behavior in the developers list
> but I think that the current implementation is correct.

What do you mean by "older Cygwin's"?
I downloaded Beta 20.1 and installed it.

Do you mean that the problem has already been fixed in the snapshots?
Has anyone actually tested (test'd) the snapshots
to determine whether this behavior still persists or not?

Should I download the latest snapshot
and use it to compile my application programs?
Or should I wait until the next release
before upgrading my compiler?

Does anyone know whether the DJGPP compiler
has been fixed and tested yet?

Thanks in advance, E. Robert Tisdale <edwin@netwood.net>



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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* ... is not writable by you
       [not found]       ` < 36D51691.6E1579DF@netwood.net >
@ 1999-02-25  3:51         ` Sebastien Barre
       [not found]           ` < 4.1.19990225124802.02724850@mail.club-internet.fr >
  1999-02-28 23:02           ` Sebastien Barre
  1999-02-25  8:02         ` setmode (long) DJ Delorie
  1999-02-25  9:25         ` Mumit Khan
  2 siblings, 2 replies; 28+ messages in thread
From: Sebastien Barre @ 1999-02-25  3:51 UTC (permalink / raw)
  To: cygwin

I'm sorry to ask, as I'm sure that this has been discussed in the archive,
but the search feature is down :(
http://www.cygnus.com/htdig/searchcygwin.html

I'm trying to install Perl 5.005_2 (compilation and test suceeded), and it
fails on :

./perl installperl
/usr/local/bin is not writable by you
make: *** [install.perl] Error 2

But I have the right to do so I guess :

administrateur [6] /usr/local$ ll
total 0
drwxr-xr-x   2 administ Aucun           0 Feb 24 01:50 bin/
drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 include/
drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 info/
drwxr-xr-x   3 administ Aucun           0 Feb 16 11:34 lib/
drwxr-xr-x   4 administ Aucun           0 Feb 16 11:34 man/
drwxr-xr-x   5 administ Aucun           0 Feb 23 09:17 share/

Could someone be kind enough to forward me to the corresponding article ?

Thanks a lot, and sorry for the "spam".

______________________________________________________________
Sebastien Barre                  http://www.hds.utc.fr/~barre/

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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: ... is not writable by you
       [not found]           ` < 4.1.19990225124802.02724850@mail.club-internet.fr >
@ 1999-02-25  7:21             ` Dennis Newbold
       [not found]               ` < Pine.LNX.3.96.990225083630.12938A-100000@blackberry.ivs.com >
  1999-02-28 23:02               ` Dennis Newbold
  0 siblings, 2 replies; 28+ messages in thread
From: Dennis Newbold @ 1999-02-25  7:21 UTC (permalink / raw)
  To: Sebastien Barre; +Cc: cygwin

Dear Sebastien,

     Not only do you have to have write access to /usr/local/bin, you
also need write access to /usr/local, and quite possibly to /usr as well.
The ls output you provide does not show the access bits for these two
directories.  Check this out, and if necessary, do the proper chmod
on them.  Good luck.  Hope this helps.

On Thu, 25 Feb 1999, Sebastien Barre wrote:

> I'm sorry to ask, as I'm sure that this has been discussed in the archive,
> but the search feature is down :(
> http://www.cygnus.com/htdig/searchcygwin.html
> 
> I'm trying to install Perl 5.005_2 (compilation and test suceeded), and it
> fails on :
> 
> ./perl installperl
> /usr/local/bin is not writable by you
> make: *** [install.perl] Error 2
> 
> But I have the right to do so I guess :
> 
> administrateur [6] /usr/local$ ll
> total 0
> drwxr-xr-x   2 administ Aucun           0 Feb 24 01:50 bin/
> drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 include/
> drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 info/
> drwxr-xr-x   3 administ Aucun           0 Feb 16 11:34 lib/
> drwxr-xr-x   4 administ Aucun           0 Feb 16 11:34 man/
> drwxr-xr-x   5 administ Aucun           0 Feb 23 09:17 share/
> 
> Could someone be kind enough to forward me to the corresponding article ?
> 
> Thanks a lot, and sorry for the "spam".
> 
> ______________________________________________________________
> Sebastien Barre                  http://www.hds.utc.fr/~barre/
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> 


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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
       [not found]       ` < 36D51691.6E1579DF@netwood.net >
  1999-02-25  3:51         ` ... is not writable by you Sebastien Barre
@ 1999-02-25  8:02         ` DJ Delorie
  1999-02-25 22:44           ` E. Robert Tisdale
  1999-02-28 23:02           ` DJ Delorie
  1999-02-25  9:25         ` Mumit Khan
  2 siblings, 2 replies; 28+ messages in thread
From: DJ Delorie @ 1999-02-25  8:02 UTC (permalink / raw)
  To: edwin; +Cc: cygwin

> Does anyone know whether the DJGPP compiler has been fixed and
> tested yet?

I don't know of any fixes relevent to this, but you might try using
egcs for djgpp instead of gcc - it has a different C++ library.

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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
       [not found]       ` < 36D51691.6E1579DF@netwood.net >
  1999-02-25  3:51         ` ... is not writable by you Sebastien Barre
  1999-02-25  8:02         ` setmode (long) DJ Delorie
@ 1999-02-25  9:25         ` Mumit Khan
  1999-02-28 23:02           ` Mumit Khan
  2 siblings, 1 reply; 28+ messages in thread
From: Mumit Khan @ 1999-02-25  9:25 UTC (permalink / raw)
  To: E. Robert Tisdale; +Cc: cygwin

On Thu, 25 Feb 1999, E. Robert Tisdale wrote:

> 
> Does anyone know whether the DJGPP compiler
> has been fixed and tested yet?
> 

You can always try it.

I did run your code using mingw32 and MSVC and it gives the same output.

Mumit


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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: ... is not writable by you
       [not found]               ` < Pine.LNX.3.96.990225083630.12938A-100000@blackberry.ivs.com >
@ 1999-02-25  9:41                 ` Sebastien Barre
  1999-02-25 11:14                   ` John Fortin
  1999-02-28 23:02                   ` Sebastien Barre
  0 siblings, 2 replies; 28+ messages in thread
From: Sebastien Barre @ 1999-02-25  9:41 UTC (permalink / raw)
  To: Dennis Newbold; +Cc: cygwin

At 08:51 25/02/99 -0800, Dennis Newbold wrote:

>     Not only do you have to have write access to /usr/local/bin, you
>also need write access to /usr/local, and quite possibly to /usr as well.

Yes of course, I have these rights :)

administrateur [8] /$ ll
total 0
drwxr-xr-x   7 administ Aucun           0 Feb 16 09:29 usr/
administrateur [9] /$ cd usr/
administrateur [11] /usr$ ll
total 0
drwxr-xr-x   8 administ Aucun           0 Feb 16 11:34 local/
administrateur [14] /usr$ ll local
total 0
drwxr-xr-x   2 administ Aucun           0 Feb 24 01:50 bin/
drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 include/
drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 info/
drwxr-xr-x   3 administ Aucun           0 Feb 16 11:34 lib/
drwxr-xr-x   4 administ Aucun           0 Feb 16 11:34 man/
drwxr-xr-x   5 administ Aucun           0 Feb 23 09:17 share/


______________________________________________________________
Sebastien Barre                  http://www.hds.utc.fr/~barre/

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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: ... is not writable by you
  1999-02-25  9:41                 ` Sebastien Barre
@ 1999-02-25 11:14                   ` John Fortin
       [not found]                     ` < 36D59F7D.81FA327@ibm.net >
  1999-02-28 23:02                     ` John Fortin
  1999-02-28 23:02                   ` Sebastien Barre
  1 sibling, 2 replies; 28+ messages in thread
From: John Fortin @ 1999-02-25 11:14 UTC (permalink / raw)
  To: Sebastien Barre; +Cc: Dennis Newbold, cygwin

What is you userid though.  If the files were created by you and you are part
of the administrator group, the files are OWNED by the administrator ID.  If
your userid is not the administrator then you only have read/execute rights.

    I ran into this with a very simple makefile about 2 weeks ago.  I wasn't
the administrator, but was part of the administrator group. I could not write
into the directory because the Administrator id owned it.

Hope this helps,
John Fortin
fortinj@ibm.net


Sebastien Barre wrote:

> At 08:51 25/02/99 -0800, Dennis Newbold wrote:
>
> >     Not only do you have to have write access to /usr/local/bin, you
> >also need write access to /usr/local, and quite possibly to /usr as well.
>
> Yes of course, I have these rights :)
>
> administrateur [8] /$ ll
> total 0
> drwxr-xr-x   7 administ Aucun           0 Feb 16 09:29 usr/
> administrateur [9] /$ cd usr/
> administrateur [11] /usr$ ll
> total 0
> drwxr-xr-x   8 administ Aucun           0 Feb 16 11:34 local/
> administrateur [14] /usr$ ll local
> total 0
> drwxr-xr-x   2 administ Aucun           0 Feb 24 01:50 bin/
> drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 include/
> drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 info/
> drwxr-xr-x   3 administ Aucun           0 Feb 16 11:34 lib/
> drwxr-xr-x   4 administ Aucun           0 Feb 16 11:34 man/
> drwxr-xr-x   5 administ Aucun           0 Feb 23 09:17 share/
>
> ______________________________________________________________
> Sebastien Barre                  http://www.hds.utc.fr/~barre/
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com




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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: ... is not writable by you
       [not found]                     ` < 36D59F7D.81FA327@ibm.net >
@ 1999-02-25 16:33                       ` Sebastien Barre
  1999-02-28 23:02                         ` Sebastien Barre
  0 siblings, 1 reply; 28+ messages in thread
From: Sebastien Barre @ 1999-02-25 16:33 UTC (permalink / raw)
  To: John Fortin; +Cc: Dennis Newbold, cygwin

At 14:07 25/02/99 -0500, John Fortin wrote:

>What is you userid though.  If the files were created by you and you are part
>of the administrator group, the files are OWNED by the administrator ID.  If
>your userid is not the administrator then you only have read/execute rights.

As seen in my example, the prompt PS1 shows that *I* am the administrator,
it's a standalone workstation which belongs to me :)

It might be related to Perl anyway, because the install script is written
in Perl. Here is the problematic part :

if ($d_dosuid && $>) { die "You must run as root to install suidperl\n"; }
   $installbin		|| die "No installbin directory in config.sh\n";
-d $installbin		|| mkpath($installbin, 1, 0777);
-d $installbin		|| $nonono || die "$installbin is not a directory\n";
-w $installbin		|| $nonono || die "$installbin is not writable by you\n"
	unless $installbin =~ m#^/afs/# || $nonono;

I removed the -w line, and it works. But I'd like to *understand* the problem.

______________________________________________________________
Sebastien Barre                  http://www.hds.utc.fr/~barre/

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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
  1999-02-25  8:02         ` setmode (long) DJ Delorie
@ 1999-02-25 22:44           ` E. Robert Tisdale
  1999-02-28 23:02             ` E. Robert Tisdale
  1999-02-28 23:02           ` DJ Delorie
  1 sibling, 1 reply; 28+ messages in thread
From: E. Robert Tisdale @ 1999-02-25 22:44 UTC (permalink / raw)
  To: cygwin

DJ Delorie wrote:

> > Does anyone know whether the DJGPP compiler has been fixed and
> > tested yet?
>
> I don't know of any fixes relevent to this, but you might try using
> egcs for djgpp instead of gcc - it has a different C++ library.

How many compilers are there?
I got my DJGPP compiler by following the links

    CYGWIN-->Related Sites-->DJGPP Home Page-->Zip Picker

from

    http://www.cygnus.com/

and I think I ended up getting the files from

    ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/

Do I need to go somewhere else to get the egcs compiler?

Thanks in advance, E. Robert Tisdale <edwin@netwood.net>


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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
  1999-02-24 11:42   ` Christopher Faylor
  1999-02-25  1:26     ` E. Robert Tisdale
@ 1999-02-28 23:02     ` Christopher Faylor
  1 sibling, 0 replies; 28+ messages in thread
From: Christopher Faylor @ 1999-02-28 23:02 UTC (permalink / raw)
  To: E. Robert Tisdale; +Cc: cygwin

On Tue, Feb 23, 1999 at 10:19:47PM -0800, E. Robert Tisdale wrote:
>...shows that test.out was opened in binary mode
>and setmode didn't switch to text mode.

That's right in older Cygwin's setting the mode to TEXT didn't
necessarily change the mode.  This should be fixed in the
snapshots.

We have gone around and around on this behavior in the developers
list but I think that the current implementation is correct.

cgf

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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
  1999-02-25  9:25         ` Mumit Khan
@ 1999-02-28 23:02           ` Mumit Khan
  0 siblings, 0 replies; 28+ messages in thread
From: Mumit Khan @ 1999-02-28 23:02 UTC (permalink / raw)
  To: E. Robert Tisdale; +Cc: cygwin

On Thu, 25 Feb 1999, E. Robert Tisdale wrote:

> 
> Does anyone know whether the DJGPP compiler
> has been fixed and tested yet?
> 

You can always try it.

I did run your code using mingw32 and MSVC and it gives the same output.

Mumit


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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* ... is not writable by you
  1999-02-25  3:51         ` ... is not writable by you Sebastien Barre
       [not found]           ` < 4.1.19990225124802.02724850@mail.club-internet.fr >
@ 1999-02-28 23:02           ` Sebastien Barre
  1 sibling, 0 replies; 28+ messages in thread
From: Sebastien Barre @ 1999-02-28 23:02 UTC (permalink / raw)
  To: cygwin

I'm sorry to ask, as I'm sure that this has been discussed in the archive,
but the search feature is down :(
http://www.cygnus.com/htdig/searchcygwin.html

I'm trying to install Perl 5.005_2 (compilation and test suceeded), and it
fails on :

./perl installperl
/usr/local/bin is not writable by you
make: *** [install.perl] Error 2

But I have the right to do so I guess :

administrateur [6] /usr/local$ ll
total 0
drwxr-xr-x   2 administ Aucun           0 Feb 24 01:50 bin/
drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 include/
drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 info/
drwxr-xr-x   3 administ Aucun           0 Feb 16 11:34 lib/
drwxr-xr-x   4 administ Aucun           0 Feb 16 11:34 man/
drwxr-xr-x   5 administ Aucun           0 Feb 23 09:17 share/

Could someone be kind enough to forward me to the corresponding article ?

Thanks a lot, and sorry for the "spam".

______________________________________________________________
Sebastien Barre                  http://www.hds.utc.fr/~barre/

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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
  1999-02-25  8:02         ` setmode (long) DJ Delorie
  1999-02-25 22:44           ` E. Robert Tisdale
@ 1999-02-28 23:02           ` DJ Delorie
  1 sibling, 0 replies; 28+ messages in thread
From: DJ Delorie @ 1999-02-28 23:02 UTC (permalink / raw)
  To: edwin; +Cc: cygwin

> Does anyone know whether the DJGPP compiler has been fixed and
> tested yet?

I don't know of any fixes relevent to this, but you might try using
egcs for djgpp instead of gcc - it has a different C++ library.

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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
  1999-02-25 22:44           ` E. Robert Tisdale
@ 1999-02-28 23:02             ` E. Robert Tisdale
  0 siblings, 0 replies; 28+ messages in thread
From: E. Robert Tisdale @ 1999-02-28 23:02 UTC (permalink / raw)
  To: cygwin

DJ Delorie wrote:

> > Does anyone know whether the DJGPP compiler has been fixed and
> > tested yet?
>
> I don't know of any fixes relevent to this, but you might try using
> egcs for djgpp instead of gcc - it has a different C++ library.

How many compilers are there?
I got my DJGPP compiler by following the links

    CYGWIN-->Related Sites-->DJGPP Home Page-->Zip Picker

from

    http://www.cygnus.com/

and I think I ended up getting the files from

    ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/

Do I need to go somewhere else to get the egcs compiler?

Thanks in advance, E. Robert Tisdale <edwin@netwood.net>


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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: ... is not writable by you
  1999-02-25 11:14                   ` John Fortin
       [not found]                     ` < 36D59F7D.81FA327@ibm.net >
@ 1999-02-28 23:02                     ` John Fortin
  1 sibling, 0 replies; 28+ messages in thread
From: John Fortin @ 1999-02-28 23:02 UTC (permalink / raw)
  To: Sebastien Barre; +Cc: Dennis Newbold, cygwin

What is you userid though.  If the files were created by you and you are part
of the administrator group, the files are OWNED by the administrator ID.  If
your userid is not the administrator then you only have read/execute rights.

    I ran into this with a very simple makefile about 2 weeks ago.  I wasn't
the administrator, but was part of the administrator group. I could not write
into the directory because the Administrator id owned it.

Hope this helps,
John Fortin
fortinj@ibm.net


Sebastien Barre wrote:

> At 08:51 25/02/99 -0800, Dennis Newbold wrote:
>
> >     Not only do you have to have write access to /usr/local/bin, you
> >also need write access to /usr/local, and quite possibly to /usr as well.
>
> Yes of course, I have these rights :)
>
> administrateur [8] /$ ll
> total 0
> drwxr-xr-x   7 administ Aucun           0 Feb 16 09:29 usr/
> administrateur [9] /$ cd usr/
> administrateur [11] /usr$ ll
> total 0
> drwxr-xr-x   8 administ Aucun           0 Feb 16 11:34 local/
> administrateur [14] /usr$ ll local
> total 0
> drwxr-xr-x   2 administ Aucun           0 Feb 24 01:50 bin/
> drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 include/
> drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 info/
> drwxr-xr-x   3 administ Aucun           0 Feb 16 11:34 lib/
> drwxr-xr-x   4 administ Aucun           0 Feb 16 11:34 man/
> drwxr-xr-x   5 administ Aucun           0 Feb 23 09:17 share/
>
> ______________________________________________________________
> Sebastien Barre                  http://www.hds.utc.fr/~barre/
>
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com




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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
  1999-02-25  1:26     ` E. Robert Tisdale
       [not found]       ` < 36D51691.6E1579DF@netwood.net >
@ 1999-02-28 23:02       ` E. Robert Tisdale
  1999-03-02 18:59       ` Christopher Faylor
  2 siblings, 0 replies; 28+ messages in thread
From: E. Robert Tisdale @ 1999-02-28 23:02 UTC (permalink / raw)
  To: cygwin

Christopher Faylor wrote:

> That's right in older Cygwin's
> setting the mode to TEXT didn't necessarily change the mode.
> This should be fixed in the snapshots.
>
> We have gone around and around on this behavior in the developers list
> but I think that the current implementation is correct.

What do you mean by "older Cygwin's"?
I downloaded Beta 20.1 and installed it.

Do you mean that the problem has already been fixed in the snapshots?
Has anyone actually tested (test'd) the snapshots
to determine whether this behavior still persists or not?

Should I download the latest snapshot
and use it to compile my application programs?
Or should I wait until the next release
before upgrading my compiler?

Does anyone know whether the DJGPP compiler
has been fixed and tested yet?

Thanks in advance, E. Robert Tisdale <edwin@netwood.net>



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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: ... is not writable by you
  1999-02-25 16:33                       ` Sebastien Barre
@ 1999-02-28 23:02                         ` Sebastien Barre
  0 siblings, 0 replies; 28+ messages in thread
From: Sebastien Barre @ 1999-02-28 23:02 UTC (permalink / raw)
  To: John Fortin; +Cc: Dennis Newbold, cygwin

At 14:07 25/02/99 -0500, John Fortin wrote:

>What is you userid though.  If the files were created by you and you are part
>of the administrator group, the files are OWNED by the administrator ID.  If
>your userid is not the administrator then you only have read/execute rights.

As seen in my example, the prompt PS1 shows that *I* am the administrator,
it's a standalone workstation which belongs to me :)

It might be related to Perl anyway, because the install script is written
in Perl. Here is the problematic part :

if ($d_dosuid && $>) { die "You must run as root to install suidperl\n"; }
   $installbin		|| die "No installbin directory in config.sh\n";
-d $installbin		|| mkpath($installbin, 1, 0777);
-d $installbin		|| $nonono || die "$installbin is not a directory\n";
-w $installbin		|| $nonono || die "$installbin is not writable by you\n"
	unless $installbin =~ m#^/afs/# || $nonono;

I removed the -w line, and it works. But I'd like to *understand* the problem.

______________________________________________________________
Sebastien Barre                  http://www.hds.utc.fr/~barre/

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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: ... is not writable by you
  1999-02-25  7:21             ` Dennis Newbold
       [not found]               ` < Pine.LNX.3.96.990225083630.12938A-100000@blackberry.ivs.com >
@ 1999-02-28 23:02               ` Dennis Newbold
  1 sibling, 0 replies; 28+ messages in thread
From: Dennis Newbold @ 1999-02-28 23:02 UTC (permalink / raw)
  To: Sebastien Barre; +Cc: cygwin

Dear Sebastien,

     Not only do you have to have write access to /usr/local/bin, you
also need write access to /usr/local, and quite possibly to /usr as well.
The ls output you provide does not show the access bits for these two
directories.  Check this out, and if necessary, do the proper chmod
on them.  Good luck.  Hope this helps.

On Thu, 25 Feb 1999, Sebastien Barre wrote:

> I'm sorry to ask, as I'm sure that this has been discussed in the archive,
> but the search feature is down :(
> http://www.cygnus.com/htdig/searchcygwin.html
> 
> I'm trying to install Perl 5.005_2 (compilation and test suceeded), and it
> fails on :
> 
> ./perl installperl
> /usr/local/bin is not writable by you
> make: *** [install.perl] Error 2
> 
> But I have the right to do so I guess :
> 
> administrateur [6] /usr/local$ ll
> total 0
> drwxr-xr-x   2 administ Aucun           0 Feb 24 01:50 bin/
> drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 include/
> drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 info/
> drwxr-xr-x   3 administ Aucun           0 Feb 16 11:34 lib/
> drwxr-xr-x   4 administ Aucun           0 Feb 16 11:34 man/
> drwxr-xr-x   5 administ Aucun           0 Feb 23 09:17 share/
> 
> Could someone be kind enough to forward me to the corresponding article ?
> 
> Thanks a lot, and sorry for the "spam".
> 
> ______________________________________________________________
> Sebastien Barre                  http://www.hds.utc.fr/~barre/
> 
> --
> Want to unsubscribe from this list?
> Send a message to cygwin-unsubscribe@sourceware.cygnus.com
> 


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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: ... is not writable by you
  1999-02-25  9:41                 ` Sebastien Barre
  1999-02-25 11:14                   ` John Fortin
@ 1999-02-28 23:02                   ` Sebastien Barre
  1 sibling, 0 replies; 28+ messages in thread
From: Sebastien Barre @ 1999-02-28 23:02 UTC (permalink / raw)
  To: Dennis Newbold; +Cc: cygwin

At 08:51 25/02/99 -0800, Dennis Newbold wrote:

>     Not only do you have to have write access to /usr/local/bin, you
>also need write access to /usr/local, and quite possibly to /usr as well.

Yes of course, I have these rights :)

administrateur [8] /$ ll
total 0
drwxr-xr-x   7 administ Aucun           0 Feb 16 09:29 usr/
administrateur [9] /$ cd usr/
administrateur [11] /usr$ ll
total 0
drwxr-xr-x   8 administ Aucun           0 Feb 16 11:34 local/
administrateur [14] /usr$ ll local
total 0
drwxr-xr-x   2 administ Aucun           0 Feb 24 01:50 bin/
drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 include/
drwxr-xr-x   2 administ Aucun           0 Feb 23 09:17 info/
drwxr-xr-x   3 administ Aucun           0 Feb 16 11:34 lib/
drwxr-xr-x   4 administ Aucun           0 Feb 16 11:34 man/
drwxr-xr-x   5 administ Aucun           0 Feb 23 09:17 share/


______________________________________________________________
Sebastien Barre                  http://www.hds.utc.fr/~barre/

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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* setmode (long)
  1999-02-24  0:31 setmode (long) E. Robert Tisdale
       [not found] ` < 36D39A03.89B3C703@netwood.net >
@ 1999-02-28 23:02 ` E. Robert Tisdale
  1 sibling, 0 replies; 28+ messages in thread
From: E. Robert Tisdale @ 1999-02-28 23:02 UTC (permalink / raw)
  To: cygwin

I have written an application in C++ which is supposed to compile
and run on any platform including UNIX, DOS and Windows 95/98/NT.
It reads and writes text as well as binary data from files and
standard input and output.  It uses the line feed (newline) character
to mark the end of a line and the carriage return line feed sequence
to mark the end of a paragraph.  It reads and writes text files
in binary mode and converts \r\n to \n on input and \n to \r\n
on output for DOS (and Windows 95/98/NT) systems so that the user
can read, edit and print them using native tools.

On DOS and Windows 95/98/NT systems, the C preprocessor includes code
which uses setmode to change the default I/O mode from text to binary.
This worked just fine with older versions of DJGPP on DOS
but I have just downloaded and installed the most recent versions
of DJGPP, Cygwin and mingw32 and I am experiencing some problems.
I wrote a short program, `test.cc', to help illustrate them.
----------------------------------------------------------------------

// test.cc

#include<fstream.h>
#include<io.h>
#include<fcntl.h>

int
main() {
  int   oldmode = 0;
  cout << "default mode:\n";
  cout << "  0 carriage returns\n";
  cout << "  1 carriage returns\r\n";
  cout << "  2 carriage returns\r\r\n";
  cout << "  3 carriage returns\r\r\r\n";
  oldmode = setmode(1, O_TEXT);
  cout << hex << oldmode <<
    " = setmode(1, " << hex << O_TEXT   << "):\n";
  cout << "  0 carriage returns\n";
  cout << "  1 carriage returns\r\n";
  cout << "  2 carriage returns\r\r\n";
  cout << "  3 carriage returns\r\r\r\n";
  oldmode = setmode(1, O_BINARY);
  cout << hex << oldmode <<
    " = setmode(1, " << hex << O_BINARY << "):\n";
  cout << "  0 carriage returns\n";
  cout << "  1 carriage returns\r\n";
  cout << "  2 carriage returns\r\r\n";
  cout << "  3 carriage returns\r\r\r\n";
  oldmode = setmode(1, O_TEXT);
  cout << hex << oldmode <<
    " = setmode(1, " << hex << O_TEXT   << "):\n";
  cout << "  0 carriage returns\n";
  cout << "  1 carriage returns\r\n";
  cout << "  2 carriage returns\r\r\n";
  cout << "  3 carriage returns\r\r\r\n";

  ofstream      test_out("test.out", ios::out);
  test_out << "default mode:\n";
  test_out << "  0 carriage returns\n";
  test_out << "  1 carriage returns\r\n";
  test_out << "  2 carriage returns\r\r\n";
  test_out << "  3 carriage returns\r\r\r\n";
  oldmode = setmode((test_out.rdbuf())->fd(), O_TEXT);
  test_out << hex << oldmode <<
    " = setmode((test_out.rdbuf())->fd(), " << hex << O_TEXT   << "):\n";
  test_out << "  0 carriage returns\n";
  test_out << "  1 carriage returns\r\n";
  test_out << "  2 carriage returns\r\r\n";
  test_out << "  3 carriage returns\r\r\r\n";
  oldmode = setmode((test_out.rdbuf())->fd(), O_BINARY);
  test_out << hex << oldmode <<
    " = setmode((test_out.rdbuf())->fd(), " << hex << O_BINARY << "):\n";
  test_out << "  0 carriage returns\n";
  test_out << "  1 carriage returns\r\n";
  test_out << "  2 carriage returns\r\r\n";
  test_out << "  3 carriage returns\r\r\r\n";
  oldmode = setmode((test_out.rdbuf())->fd(), O_TEXT);
  test_out << hex << oldmode <<
    " = setmode((test_out.rdbuf())->fd(), " << hex << O_TEXT   << "):\n";
  test_out << "  0 carriage returns\n";
  test_out << "  1 carriage returns\r\n";
  test_out << "  2 carriage returns\r\r\n";
  test_out << "  3 carriage returns\r\r\r\n";
  return 0;
  }
----------------------------------------------------------------------

I compiled under Windows 98 using DJGPP and a DOS shell (MS-DOS Prompt)

        >gxx -v -w -O2 -o test test.cc -lgpp

and I ran the test program

        >.\test > test.dos

I started a Cygwin-b20 bash shell and examined the results:

        $ vi test.dos
        default mode:^M
          0 carriage returns^M
          1 carriage returns^M^M
          2 carriage returns^M^M^M
          3 carriage returns^M^M^M^M
        8 = setmode(1, 8):^M
          0 carriage returns^M
          1 carriage returns^M^M
          2 carriage returns^M^M^M
          3 carriage returns^M^M^M^M
        8 = setmode(1, 4):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        4 = setmode(1, 8):^M
          0 carriage returns^M
          1 carriage returns^M^M
          2 carriage returns^M^M^M
          3 carriage returns^M^M^M^M

appears to be correct but

        $ vi test.out
        default mode:
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        8 = setmode((test_out.rdbuf())->fd(), 8):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        8 = setmode((test_out.rdbuf())->fd(), 4):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        4 = setmode((test_out.rdbuf())->fd(), 8):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M

shows that test.out was opened in binary mode
and setmode didn't switch to text mode.

----------------------------------------------------------------------

I compiled under Windows 98 using EGCS Cygwin-b20 and a bash shell

        $ g++ -v -Wall -O2 -o test test.cc

ran the test program

        $ ./test > test.cyg

and examined the results:

        $ vi test.cyg
        default mode:^M
          0 carriage returns^M
          1 carriage returns^M^M
          2 carriage returns^M^M^M
          3 carriage returns^M^M^M^M
        20000 = setmode(1, 20000):^M
          0 carriage returns^M
          1 carriage returns^M^M
          2 carriage returns^M^M^M
          3 carriage returns^M^M^M^M
        20000 = setmode(1, 10000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        10000 = setmode(1, 20000):^M
          0 carriage returns^M
          1 carriage returns^M^M
          2 carriage returns^M^M^M
          3 carriage returns^M^M^M^M

appears to be correct but

        $ vi test.out
        default mode:
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        20000 = setmode((test_out.rdbuf())->fd(), 20000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        20000 = setmode((test_out.rdbuf())->fd(), 10000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        10000 = setmode((test_out.rdbuf())->fd(), 20000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M

shows that test.out was opened in binary mode
and setmode didn't switch to text mode.

----------------------------------------------------------------------

I re-compiled under Windows 98 using EGCS Cygwin-b20 with mingw32

        $ g++ -L/mingw32/lib -L/mingw32/i386-mingw32/lib \
        -L/mingw32/lib/gcc-lib/i386-mingw32/egcs-2.91.60 \
        -v -Wall -O2 -mno-cygwin -o test test.cc -lstdc++ -liberty

and ran the test program using and a DOS shell (MS-DOS Prompt)

        >.\test > test.win

I used the Cygwin-b20 bash shell to examine the results:

        $ vi test.win
        default mode:
          0 carriage returns
          1 carriage returns
          2 carriage returns
          3 carriage returns
        4000 = setmode(1, 4000):
          0 carriage returns
          1 carriage returns
          2 carriage returns
          3 carriage returns
        4000 = setmode(1, 8000):
          0 carriage returns
          1 carriage returns
          2 carriage returns
          3 carriage returns
        8000 = setmode(1, 4000):
          0 carriage returns
          1 carriage returns
          2 carriage returns
          3 carriage returns

contains no carriage returns and

       $ vi test.out
        default mode:
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        4000 = setmode((test_out.rdbuf())->fd(), 4000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        4000 = setmode((test_out.rdbuf())->fd(), 8000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M
        8000 = setmode((test_out.rdbuf())->fd(), 4000):
          0 carriage returns
          1 carriage returns^M
          2 carriage returns^M^M
          3 carriage returns^M^M^M

shows that test.out was opened in binary mode
and setmode didn't switch to text mode.

----------------------------------------------------------------------

I didn't change any of the default settings when I installed Cygwin.
I didn't mount any file systems as binary only or define binmode.
I've read the FAQs and searched the mailing list archives.

It appears to me that there are still very serious problems
with text and binary I/O in DJGPP, Cygwin-b20 and mingw32
using Cygwin-b20 bash and MS-DOS Prompt under Windows 98.

Also, all the information regarding text and binary I/O
seems to be scattered across many different documents.
I think it would help me and other portable application
programmers if someone could put it all together
in one place with expicit references to the specific
operating system, compiler and shell to which it applies.

Thanks in advance, E. Robert Tisdale <edwin@netwood.net>

NOTE:   My editor, `vi', displays a carriage return as ^M
        but the line feed at the end of the line is invisible.
        My DOS shell is C:\WINDOWS\COMMAND.COM



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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
  1999-02-25  1:26     ` E. Robert Tisdale
       [not found]       ` < 36D51691.6E1579DF@netwood.net >
  1999-02-28 23:02       ` E. Robert Tisdale
@ 1999-03-02 18:59       ` Christopher Faylor
  1999-03-03 19:29         ` E. Robert Tisdale
  1999-03-31 19:45         ` Christopher Faylor
  2 siblings, 2 replies; 28+ messages in thread
From: Christopher Faylor @ 1999-03-02 18:59 UTC (permalink / raw)
  To: E. Robert Tisdale; +Cc: cygwin

On Thu, Feb 25, 1999 at 01:23:29AM -0800, E. Robert Tisdale wrote:
>Christopher Faylor wrote:
>> That's right in older Cygwin's
>> setting the mode to TEXT didn't necessarily change the mode.
>> This should be fixed in the snapshots.
>>
>> We have gone around and around on this behavior in the developers list
>> but I think that the current implementation is correct.
>
>What do you mean by "older Cygwin's"?
>I downloaded Beta 20.1 and installed it.
>
>Do you mean that the problem has already been fixed in the snapshots?
>Has anyone actually tested (test'd) the snapshots
>to determine whether this behavior still persists or not?

Yes.  I meant that this has been fixed in the latest snapshots.

>Should I download the latest snapshot
>and use it to compile my application programs?
>Or should I wait until the next release
>before upgrading my compiler?

That's not a decision I can make.  You're welcome to try a snapshot
but snapshots carry no guarantees as far as stability is concerned.
However, this is a DLL problem so you should not have to recompile
your program to see a benefit.

cgf

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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
  1999-03-02 18:59       ` Christopher Faylor
@ 1999-03-03 19:29         ` E. Robert Tisdale
       [not found]           ` < 36DDFD4C.B4B6F7C4@netwood.net >
  1999-03-31 19:45           ` E. Robert Tisdale
  1999-03-31 19:45         ` Christopher Faylor
  1 sibling, 2 replies; 28+ messages in thread
From: E. Robert Tisdale @ 1999-03-03 19:29 UTC (permalink / raw)
  To: cygwin

Christopher Faylor wrote:

> On Thu, Feb 25, 1999 at 01:23:29AM -0800,
> E. Robert Tisdale wrote:
> >Should I download the latest snapshot
> >and use it to compile my application programs?
> >Or should I wait until the next release
> >before upgrading my compiler?
>
> That's not a decision I can make.  You're welcome to try a snapshot
> but snapshots carry no guarantees as far as stability is concerned.
> However, this is a DLL problem
> so you should not have to recompile your program to see a benefit.

Duh... Which DLL?

Thanks in advance, E. Robert Tisdale <edwin@netwood.net>



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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
       [not found]           ` < 36DDFD4C.B4B6F7C4@netwood.net >
@ 1999-03-04  8:17             ` Chris Faylor
  1999-03-31 19:45               ` Chris Faylor
  0 siblings, 1 reply; 28+ messages in thread
From: Chris Faylor @ 1999-03-04  8:17 UTC (permalink / raw)
  To: E. Robert Tisdale; +Cc: cygwin

On Wed, Mar 03, 1999 at 07:26:05PM -0800, E. Robert Tisdale wrote:
>Christopher Faylor wrote:
>> On Thu, Feb 25, 1999 at 01:23:29AM -0800,
>> E. Robert Tisdale wrote:
>> >Should I download the latest snapshot
>> >and use it to compile my application programs?
>> >Or should I wait until the next release
>> >before upgrading my compiler?
>>
>> That's not a decision I can make.  You're welcome to try a snapshot
>> but snapshots carry no guarantees as far as stability is concerned.
>> However, this is a DLL problem
>> so you should not have to recompile your program to see a benefit.
>
>Duh... Which DLL?
>
>Thanks in advance, E. Robert Tisdale <edwin@netwood.net>

Huh?  The *cygwin* DLL.  What other DLL would I possibly be talking about?

Possibly you are asking exactly which snapshot to download.  I have no
idea when this was changed but you can check the ChangeLogs.

cgf

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

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
  1999-03-03 19:29         ` E. Robert Tisdale
       [not found]           ` < 36DDFD4C.B4B6F7C4@netwood.net >
@ 1999-03-31 19:45           ` E. Robert Tisdale
  1 sibling, 0 replies; 28+ messages in thread
From: E. Robert Tisdale @ 1999-03-31 19:45 UTC (permalink / raw)
  To: cygwin

Christopher Faylor wrote:

> On Thu, Feb 25, 1999 at 01:23:29AM -0800,
> E. Robert Tisdale wrote:
> >Should I download the latest snapshot
> >and use it to compile my application programs?
> >Or should I wait until the next release
> >before upgrading my compiler?
>
> That's not a decision I can make.  You're welcome to try a snapshot
> but snapshots carry no guarantees as far as stability is concerned.
> However, this is a DLL problem
> so you should not have to recompile your program to see a benefit.

Duh... Which DLL?

Thanks in advance, E. Robert Tisdale <edwin@netwood.net>



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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
  1999-03-02 18:59       ` Christopher Faylor
  1999-03-03 19:29         ` E. Robert Tisdale
@ 1999-03-31 19:45         ` Christopher Faylor
  1 sibling, 0 replies; 28+ messages in thread
From: Christopher Faylor @ 1999-03-31 19:45 UTC (permalink / raw)
  To: E. Robert Tisdale; +Cc: cygwin

On Thu, Feb 25, 1999 at 01:23:29AM -0800, E. Robert Tisdale wrote:
>Christopher Faylor wrote:
>> That's right in older Cygwin's
>> setting the mode to TEXT didn't necessarily change the mode.
>> This should be fixed in the snapshots.
>>
>> We have gone around and around on this behavior in the developers list
>> but I think that the current implementation is correct.
>
>What do you mean by "older Cygwin's"?
>I downloaded Beta 20.1 and installed it.
>
>Do you mean that the problem has already been fixed in the snapshots?
>Has anyone actually tested (test'd) the snapshots
>to determine whether this behavior still persists or not?

Yes.  I meant that this has been fixed in the latest snapshots.

>Should I download the latest snapshot
>and use it to compile my application programs?
>Or should I wait until the next release
>before upgrading my compiler?

That's not a decision I can make.  You're welcome to try a snapshot
but snapshots carry no guarantees as far as stability is concerned.
However, this is a DLL problem so you should not have to recompile
your program to see a benefit.

cgf

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


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: setmode (long)
  1999-03-04  8:17             ` Chris Faylor
@ 1999-03-31 19:45               ` Chris Faylor
  0 siblings, 0 replies; 28+ messages in thread
From: Chris Faylor @ 1999-03-31 19:45 UTC (permalink / raw)
  To: E. Robert Tisdale; +Cc: cygwin

On Wed, Mar 03, 1999 at 07:26:05PM -0800, E. Robert Tisdale wrote:
>Christopher Faylor wrote:
>> On Thu, Feb 25, 1999 at 01:23:29AM -0800,
>> E. Robert Tisdale wrote:
>> >Should I download the latest snapshot
>> >and use it to compile my application programs?
>> >Or should I wait until the next release
>> >before upgrading my compiler?
>>
>> That's not a decision I can make.  You're welcome to try a snapshot
>> but snapshots carry no guarantees as far as stability is concerned.
>> However, this is a DLL problem
>> so you should not have to recompile your program to see a benefit.
>
>Duh... Which DLL?
>
>Thanks in advance, E. Robert Tisdale <edwin@netwood.net>

Huh?  The *cygwin* DLL.  What other DLL would I possibly be talking about?

Possibly you are asking exactly which snapshot to download.  I have no
idea when this was changed but you can check the ChangeLogs.

cgf

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


^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~1999-03-31 19:45 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-24  0:31 setmode (long) E. Robert Tisdale
     [not found] ` < 36D39A03.89B3C703@netwood.net >
1999-02-24 11:42   ` Christopher Faylor
1999-02-25  1:26     ` E. Robert Tisdale
     [not found]       ` < 36D51691.6E1579DF@netwood.net >
1999-02-25  3:51         ` ... is not writable by you Sebastien Barre
     [not found]           ` < 4.1.19990225124802.02724850@mail.club-internet.fr >
1999-02-25  7:21             ` Dennis Newbold
     [not found]               ` < Pine.LNX.3.96.990225083630.12938A-100000@blackberry.ivs.com >
1999-02-25  9:41                 ` Sebastien Barre
1999-02-25 11:14                   ` John Fortin
     [not found]                     ` < 36D59F7D.81FA327@ibm.net >
1999-02-25 16:33                       ` Sebastien Barre
1999-02-28 23:02                         ` Sebastien Barre
1999-02-28 23:02                     ` John Fortin
1999-02-28 23:02                   ` Sebastien Barre
1999-02-28 23:02               ` Dennis Newbold
1999-02-28 23:02           ` Sebastien Barre
1999-02-25  8:02         ` setmode (long) DJ Delorie
1999-02-25 22:44           ` E. Robert Tisdale
1999-02-28 23:02             ` E. Robert Tisdale
1999-02-28 23:02           ` DJ Delorie
1999-02-25  9:25         ` Mumit Khan
1999-02-28 23:02           ` Mumit Khan
1999-02-28 23:02       ` E. Robert Tisdale
1999-03-02 18:59       ` Christopher Faylor
1999-03-03 19:29         ` E. Robert Tisdale
     [not found]           ` < 36DDFD4C.B4B6F7C4@netwood.net >
1999-03-04  8:17             ` Chris Faylor
1999-03-31 19:45               ` Chris Faylor
1999-03-31 19:45           ` E. Robert Tisdale
1999-03-31 19:45         ` Christopher Faylor
1999-02-28 23:02     ` Christopher Faylor
1999-02-28 23:02 ` E. Robert Tisdale

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).