Difference between Cygwin and DOS handling of string input

B

Ben Bacarisse

Nick said:
Can someone remind me exactly of how this works. AIUI (and could be
wrong), '\n' will be translated to whatever is appropriate for the
system.

On output to a text file, yes, but binary mode is best for handling a
protocol stream.
So could generate a CR LF pair on DOS and its descendents, LF on
Unix and something else entirely on something else (like start next
record on IBMs with fixed length records).

If I want to send the necessary characters for an Internet header,
irrespective of what OS my code will be running on (well, as far as Unix
and Windows goes anyway) what should I write? Is there a risk that "\r\n"
will generate two CRs?

Not on a binary stream. The best way to ensure you get what you write
(or that you read what is really there) is to use binary mode for such
streams.
Should I assume ASCII and send 10 and 13
(probably in octal)?

The protocol will say exactly what codes to send so you don't have to
assume anything.
 
D

Dik T. Winter

>
> In UNIX ^Z has been "stop process" for a very long time (hint: before
> MS-DOS).

Barely. Job control came into BSD Unix with 4BSD with the renewed C shell,
in 1980. MS-DOS came into being in 1981.
 
T

Tom St Denis

Download cygwin, and 10 minutes later all of the above problems are
solved.  Why complain when an easy solution is already out there?

But you PAY for Windows. That's like saying spend $100K on a
supercar, then having my friend Larry tweak it up for you to make it
enjoyable. If Windows were free than what you're saying would make
sense, but since you pay for it, it should be at least as good as the
competition.
December 25th is a Christian holiday.  There is a sliver of truth in
your claim, but as usual, you've gotten almost all the facts wrong,
and you were incredibly lame and annoying in the process.

The putting of Christs Mass around Dec 25th stems DIRECTLY from the
Winter Solstice celebrations. Christians like to think they invented
everything, and that everything they have is original and sacred.
It's not. It's the same bullshit invention as you go along as every
other religion. My point though is arguing with them is much the same
as the trolls here. They ignore all of your facts and reply with
nonsense character assassinations.
Obviously Windows is different from UNIX.  Windows is easy to use.  If
you place a higher priority on "advanced" features, then, uh, don't
use Windows?

I don't find Ubuntu "hard to use." But that's also because I take
personal responsibility to not be a helpless individual at all times.
But more so, even if I didn't know how to use the shells and terminals
in Linux I think I could still navigate around the Gnome desktop with
relative ease. Saying "Linux is hard" is a mantra Windows defenders
use all the time. I just wish they'd stop chanting it long enough to
realize it's not true. Assuming you don't have a physical or mental
handicap..., if I sit you down in front of a Ubuntu box and you can't
figure out how to get firefox loaded in say under 1 minute, you're
just a helpless individual and people should rightly mock you because
you should be ashamed of how incapable you are.

Tom
 
T

Tom St Denis

There's a word for that. 'Denial'.

I guess we have different criteria for advanced or modern. To me if I
BUY and install a distro [of whatever] then have to buy/find/scrounge
around for tools to actually make it useful, while many other distros
make that available by default... it's not an advanced OS.

I mean let's work down the list of things you don't get from a blank
Vista/Win7 install

- compiler, build tools like make, cvs/rcs, debuggers, etc...
- real shell [that is compatible with the 1000s upon 1000s of scripts
out there]
- remote shell access [rdesktop is cool but let's be real, TTY is
often better]
- Office Suite
- Image Editing Tools
- Audio Mixing Tools
- Tux Racer
- Ton of userland tools that make work possible (perl, sed, awk, grep,
find, xargs, gzip, ...)
- oh, and the source to all of that
Powershell. And cmd *is* a shell.

cmd.exe is a shell in that it's a TTY that lets you run commands, but
compared to the versatility of say bash ... get real.

And Powershell is not remotely compatible with sh/csh/tcsh/bash. It
uses it's own scripting language because it's "special."
Please point me to the Linux/UNIX analogous of OllyDbg. Then you can
talk shit again.

Well show me in Win7 where you get tools like sed, perl, awk,
grep, ...

And before you comment on the usefulness, a very common one I get is
say you have a directory of 100s of files with the names like

Family_Summer_2007_*.jpg

And you want to change it to 2008. How do you do that in Powershell
or cmd.exe?
Have you tried apt-get install on Ubuntu lately?

I *can* install apps into my home dir. Not through apt-get mind you,
but by other means. I've made use of this on boxes I don't own
before...
As of this line, you are redirected to various bug and vulnerability
reports for the Linux kernel..

Yes, but they're at least open about it and fix it (hint: where I work
we submit patches to the LKML...).
MS management are very bright entrepreneurs. Asshole are, evidently,
everywhere.

They're very good at segregating the market so they don't have to
compete on core technical competence. I mean look at every single
thing they do

- C#, designed to compete against Java. Not compatible
- IE, with variations on CSS, adds things like activex to be non-
comptaible
- WMP, invents a variant container called .AVI and .wma/wmv using
basically the same MPEG codecs, non compatible
- Office, stores documents in proprietary binary formats, does not
import/export ODF, only available on Windows
- Visual Studio, uses their own variant of make, is not C99 compatible
[or try to be], IDE tied to the compiler.
- MSN, came after ICQ, it's just different
- CIFS/SAMBA, because NFS is too hard
- etc, etc, etc...

And I'm not saying those apps are all shit, but there is also no real
technical reason they aren't compatible with one another other than
they want more money, they're greedy. Look at the recent Java
developments. Part of the argument for C# was that Java was behind
the times. But apparently Java is fluid, as they're adding new
language constructs ... Ask any web developer that supports IE and
other browsers which is their favourite browser...

People who blindly support these types of actions are just
contributing to the mass mess of mediocrity where instead of pitting
engineers head to head on how best to implement given standards, they
let their business managers decide the technical details on how best
to screw over their end users.

Tom
 
W

Willem

Squeamizh wrote:
)> Arguing with you people is like arguing with Christians.  I can say
)> something like "December 25th is actually a pagan holiday celebrating
)> the winter solstice" and you'll just slap "na-huh, it's a jesus day
)> and you're a poopy head!!!"

You just made his point: (text in blockquotes is mine).

) December 25th is a Christian holiday. [meaning: na-huh, it's a jesus day]
) There is a sliver of truth in your claim, but as usual, you've gotten
) almost all the facts wrong, and you were incredibly lame and annoying
) in the process. [meaning: and you're a poopy head!!!]


As a side note:
What the christians did was to incorporate pagan holidays into their faith,
in an attempt to more easily convert the people to christianity. And then
they changed it around as if it was a christian holiday all along.
.... Kind of like Microsoft, isn't it ?


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
 
K

Kenny McCormack

On Dec 17, 8:23 pm, Tom St Denis <[email protected]> wrote:> Also I don't
consider Windows "modern."  I consider them way behind
There's a word for that. 'Denial'.

I guess we have different criteria for advanced or modern. To me if I
BUY and install a distro [of whatever] then have to buy/find/scrounge
around for tools to actually make it useful, while many other distros
make that available by default... it's not an advanced OS.

I mean let's work down the list of things you don't get from a blank
Vista/Win7 install
etc.

First, this is certainly:

Off topic. Not portable. Cant discuss it here. Blah, blah, blah.

(Where are the regs pointing this out - and redirecting you to, oh, say,
comp.something.something.advocacy?)

Second, I won't go over your stuff point-by-point, but do note that just
about everything that you see as a problem with Windows, is seen by
Windows defenders and most of the rest of the world as features. So, as
in a lot of the US political debate, we're not arguing over the facts,
we're arguing over what they mean. I.e., over what is good and what is
bad.

The real point is that Microsoft/DOS/Windows was designed from the
ground up to make money. To produce a healthy software industry, to
provide jobs for individuals, and to promote a thriving economy. That
often means specifically not being too good. If they ever actually get
it right, it could destroy the last good export (software) that the US
has. And most people, that is, outside of eggheads like us, view all of
the above as the real point. The software/OS itself is merely means to
ends.

Third, re: desktops. Yes, it is there (in current versions of Windows).
No, there are no tools provided out-of-the-box to access it. You have
to write your own, as I have done (or purchase one). And, no, you can't
move a window between desktops, but, again, this is a *feature* (i.e.,
as above, it is a question of what you think is good). Finally, if you
want the more fluid kind of desktops that Linux windows managers
provide, there are simpler tools available (I d/l'd one decades ago that
was written in assembler - the guy who wrote it was so proud of how
small it was - and that he had written it in pure assembler).
 
D

Dik T. Winter

> To install gcc, for instance, you need to be root to
> acess /usr/local/bin. Yes, you can install everything under your
> own directory, but (as you know very well) that wouldn't be very
> practical.

I would not know why that would be impractical. I have done just such
a thing many times. And many people at this institute install apps in
their home directory because they do not have root access on their
desktop.
 
T

Tom St Denis

Second, I won't go over your stuff point-by-point, but do note that just
about everything that you see as a problem with Windows, is seen by
Windows defenders and most of the rest of the world as features.  So, as
in a lot of the US political debate, we're not arguing over the facts,
we're arguing over what they mean.  I.e., over what is good and what is
bad.

I think the vast majority of people fall into one of two categories

1) Windows does just enough for them [i.e. it's the IE box] that
they're cool with it

2) It doesn't but they're unaware of serious alternatives and they
just put up with it.

The split for most "happy" users is probably something like 90%/10%.

But my point is even the people in camp #1 are better served with an
OSS distro. Not only do they save money, but it forces Microsoft to
compete on technical grounds [re: innovation] as opposed to market
share grounds [re: brand recognition]. We *all* lose out, even Linux
users when Microsoft doesn't compete because there ARE plenty of smart
and brilliant people at MSFT who are otherwise bound to work in anti-
competitive manners.
The real point is that Microsoft/DOS/Windows was designed from the
ground up to make money.  To produce a healthy software industry, to
provide jobs for individuals, and to promote a thriving economy.  That
often means specifically not being too good.  If they ever actually get
it right, it could destroy the last good export (software) that the US
has.  And most people, that is, outside of eggheads like us, view all of
the above as the real point.  The software/OS itself is merely means to
ends.

I think there is a market for OSS too, and it's more on the service
side than the boxed software side. There will always be a niche for
custom tools and odd software (like FPGA layout/synth tools for
instance). But for common things like compilers, OSes, browsers, etc,
it's just not there. And doing things to prolong the death of the
market is not helping people.
Third, re: desktops.  Yes, it is there (in current versions of Windows)..
No, there are no tools provided out-of-the-box to access it.  You have
to write your own, as I have done (or purchase one).  And, no, you can't
move a window between desktops, but, again, this is a *feature* (i.e.,
as above, it is a question of what you think is good).  Finally, if you
want the more fluid kind of desktops that Linux windows managers
provide, there are simpler tools available (I d/l'd one decades ago that
was written in assembler - the guy who wrote it was so proud of how
small it was - and that he had written it in pure assembler).

My point isn't that you can't do things with Windows, it's that if you
buy a new PC with a blank HD, then spend $299 on a copy of Windows 7,
what do you get? Now change the scenario to you buy a blank CD-R and
write Ubuntu 9.10 on it. What do you get?

For most people they "get" a savings of $299. They're not developers/
etc so they just want a desktop to store their pictures/mp3s and
browse the web. But secretly they're also getting innovation as there
is competition on the engineering side to improve the OS and tools
underneath. They're also not fostering a business that shouldn't
exist [in the form it does]. For the rest they're getting an OS/
distro they can actually out of the box do work with.

If I, Tom St Denis, am going to shell out $299 for an OS/Distro I
better have tools after I finish the install process. If all I'm
doing is installing a host OS for OSS tools, I'll just install an OSS
OS.

Tom
 
K

Kenny McCormack

I would not know why that would be impractical. I have done just such
a thing many times. And many people at this institute install apps in
their home directory because they do not have root access on their
desktop.

You guys are missing the point. The fact that you need to be
Administrator to install (most) apps on a Windows box is a *FEATURE*.
It was designed this way intentionally and on purpose. It was not any
kind of oversight or bug or limitation. It was done this way in direct
response to corporate requirements.

I know this sounds heretical to most of the people here, but from the
management's point of view, you don't *WANT* people installing apps on
their machines. You *WANT* centralized control.
 
T

Tom St Denis

An advanced OS? You get more ludicrous with every post.

Name features provided by the Win7 kernel that aren't in BSD or
Linux.
You also get none of those from certain Linux installs. As a Linux user
for about 10 years now I am well aware of what is there and what isn't
and most if not all of the useful things are also downloadable for
Windows too. And you do know that tools like Aptitude download things
don't you?

Actually, your typical redhat, fedora, gentoo, ubuntu, debian,
knoppix, etc distros come with userland tools and compilers [well
maybe not all the dev libs].

But ....
Tom, you're a man blinded by your hatred and your own limited
knowledge. Stop making a fool of yourself.

You're completely missing my point.

What you're saying is "No tom, it's a good idea to shell out $299 for
a proprietary vendor locked in OS, then load it up with OSS to make it
useful" as opposed to "just find a free OS, and load it up with the
same tools, while you're at it the free OS is also not vendor locked
in, is usually technically superior, etc..."

If the $299 OS were really that good I wouldn't have to load it up
with OSS to make it useful. Basically, for me, I'd be spending $299
for a kernel and a few system tools (defrag, format, etc..).
Everything else from the webbrowser to the compilers, office suite,
shell, etc would be provided by OSS [or others]. Whereas, I can
download a Ubuntu 9.10 CD for free, get all the tools I need, and heck
even the source in case I want to hack something [and I've actually
done this on numerous occasions].

You're just arguing for arguing sake, you don't actually have a valid
point other than to say "I disagree with you."

Name me one thing you get from a Win7 install from an actual technical
or practical point of view that you don't get from an Ubuntu install.
 
T

Tom St Denis

You guys are missing the point.  The fact that you need to be
Administrator to install (most) apps on a Windows box is a *FEATURE*.
It was designed this way intentionally and on purpose.  It was not any
kind of oversight or bug or limitation.  It was done this way in direct
response to corporate requirements.

I know this sounds heretical to most of the people here, but from the
management's point of view, you don't *WANT* people installing apps on
their machines.  You *WANT* centralized control.

What they need in those cases are dumb terminals, not computers.

Tom
 
T

Tom St Denis

Err, no Tom they don't. They want computers with local hard drives,
centralized back up and administration.

Corporations do not want people installing god knows what on their
machines where are there for a fixed purpose - to run the apps critical
for their businesses. As a linux fan you, of all people, should
understand that since Linux can be locked down even more so.

No, I suspect they don't care for local storage actually. If I'm
running a shop of data entry folk I want them to have a screen,
keyboard and mouse. All their data is stored on a server which is
backed up, raided, etc... If anything they will run applications
remotely [e.g. load them off a network share].

Of course, if you can't trust your employees enough not to **** up
their own computers...

Tom
 
K

Kenny McCormack

Name features provided by the Win7 kernel that aren't in BSD or
Linux.

Well, for one thing, built-in "real" support for multiple desktops.

(That isn't either a kludge in the "window manager" [in X] or something
based on just hiding and unhiding windows)

Am I beginning to sound like a Windows advocate???

P.S. Where, or where, are the regs telling us this advocacy stuff is
really, really, off-topic? Where is a reg when you need one???
 
K

Kaz Kylheku

Wrong, I never install an app as root.

If you don't install a program as root, then the program cannot be
placed in a root-owned directory tree like /usr, and the binaries
are owned by a regular user.

That is fine if that user will be the only one using the program. If
other users use that program, they have to trust that user.
 
F

Flash Gordon

P.S. Where, or where, are the regs telling us this advocacy stuff is
really, really, off-topic? Where is a reg when you need one???

I've already made that request once. Now please, everyone, stop arguing
about which OSs are real/advanced/crap or whatever. You all know that
has sod all to do with even the widest possible definition of the
purpose of this group.
 
T

Tom St Denis

Flash Gordon said:
Wrong of course since the OS might determine the C tools in use. And C
and its uses are most definitely ARE on topic here.

Actually that's wrong anyways since this group is supposed to be for
the C language and not the compilers. Compiler support falls under
other groups specific to a particular vendor.

That being said, I think we should curtail this thread a bit (I won't
reply past here, if you feel some great need to reply do so in
private). Though once in a while it's fun to just go off on a
rant... And let's not take ourselves too too seriously. Nothing we
do here matters anyways.

Anyways, pleasant duking it out :) reply in private if you must, I
won't be reading this thread anymore.

Tom
 
R

Richard Tobin

Kaz Kylheku said:
If you don't install a program as root, then the program cannot be
placed in a root-owned directory tree like /usr, and the binaries
are owned by a regular user.

That is fine if that user will be the only one using the program. If
other users use that program, they have to trust that user.

Whereas if the user had installed them as root, other users would
have to ... trust that user.

-- Richard
 
F

Flash Gordon

Richard said:
Wrong of course since the OS might determine the C tools in use. And C
and its uses are most definitely ARE on topic here.

The state of your bank balance might determine the C tools in use, since
you might not be able to afford to buy a commercial C compiler, so do
you want to post your last bank statement here for review?
 
S

Squeamizh

Squeamizh wrote:

)> Arguing with you people is like arguing with Christians.  I can say
)> something like "December 25th is actually a pagan holiday celebrating
)> the winter solstice" and you'll just slap "na-huh, it's a jesus day
)> and you're a poopy head!!!"

You just made his point:  (text in blockquotes is mine).

) December 25th is a Christian holiday. [meaning: na-huh, it's a jesus day]
) There is a sliver of truth in your claim, but as usual, you've gotten
) almost all the facts wrong, and you were incredibly lame and annoying
) in the process.  [meaning: and you're a poopy head!!!]

Your saying "I know you are, but what am I?" doesn't somehow mean that
I "made his point." But congratulations for discovering the ultimate
debate tactic.
As a side note:
What the christians did was to incorporate pagan holidays into their faith,
in an attempt to more easily convert the people to christianity.  And then
they changed it around as if it was a christian holiday all along.

Yes, I'm aware of that theory. As I said, there is a sliver of truth
in what Tom wrote. If this theory were actually proven then perhaps
Tom wouldn't have come off as such a jackass.
... Kind of like Microsoft, isn't it ?

Huh?
 
N

Nobody

I know this sounds heretical to most of the people here, but from the
management's point of view, you don't *WANT* people installing apps on
their machines. You *WANT* centralized control.

In which case, using Windows is out of the question. Microsoft seem to be
incapable of developing anything more complex than Notepad without adding
some mechanism for it to execute arbitrary code. Being able to restrict
who can install EXEs is a bit pointless when every other program offers
99% of the functionality via JavaScript, Flash, C#, VBScript, etc.

Really, you have two choices. Either you grant certain privileges to the
user and surrender any control over the means by which the user makes use
of them (i.e. account-based controls), or you take the SELinux/RSBAC
route (role-based controls) and either spend 90% of your time saying
"not allowed", or hire at least two skilled sysadmins for each user.

The "third way" is to use account based controls along with some gimmick
that makes it appear that you actually have more control than you really
do. IOW, the first choice, but with added delusions.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top