When opening a file with open and O_TEXT, in microsoft environment, and
then reading it with read, it is done in text mode.
What does text mode exactly mean?
How is it handled in reading?
How is it handled in writing?
does text mode has an impact on function returning position within the
file? If yes, which one? 23 4263
O_TEXT wrote:
When opening a file with open and O_TEXT, in microsoft environment, and
then reading it with read, it is done in text mode.
What does text mode exactly mean?
How is it handled in reading?
How is it handled in writing?
does text mode has an impact on function returning position within the
file? If yes, which one?
DO YOUR OWN HOMEWORK!
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique http://www.cs.virginia.edu/~lcc-win32
"O_TEXT" <O_****@nospam. frwrote in message
news:fh******** ***@biggoron.ne rim.net...
When opening a file with open and O_TEXT, in microsoft environment, and
then reading it with read, it is done in text mode.
What does text mode exactly mean?
How is it handled in reading?
How is it handled in writing?
does text mode has an impact on function returning position within the
file? If yes, which one?
If you are printing out on an old-fashioned line printer you need to tell
the printer to move down to the next line, and also to return.
However if you are typing on a modern keyboard, usually the return button
will automatically move the cursor to the next line.
So the question is whether to represent newlines as "\n" or "\n\r".
Operating systems make different choices. However ANSI C has decided that
the "\n", or newline only route, will be used. So if you open a file in text
mode on an "\r\n" operating system the "\r" will be silently suppressed.
This is only good for files that actually represent text. Binary files might
have "\n\r" sequences embedded in them purely by chance.
So in the standard library we use
fopen(filename, "r");
to open in text mode for reading
fopen(filename, "rb")
to open in binary mode.
O_TEXT is just an alternative interface Microsoft have provided to the same
underlying system
--
Free games and programming goodies. http://www.personal.leeds.ac.uk/~bgy1mm
Malcolm McLean a écrit :
>
"O_TEXT" <O_****@nospam. frwrote in message
news:fh******** ***@biggoron.ne rim.net...
>When opening a file with open and O_TEXT, in microsoft environment, and then reading it with read, it is done in text mode.
What does text mode exactly mean?
How is it handled in reading?
How is it handled in writing?
does text mode has an impact on function returning position within the file? If yes, which one?
If you are printing out on an old-fashioned line printer you need to
tell the printer to move down to the next line, and also to return.
However if you are typing on a modern keyboard, usually the return
button will automatically move the cursor to the next line.
So the question is whether to represent newlines as "\n" or "\n\r".
Operating systems make different choices. However ANSI C has decided
that the "\n", or newline only route, will be used. So if you open a
file in text mode on an "\r\n" operating system the "\r" will be
silently suppressed.
This is only good for files that actually represent text. Binary files
might have "\n\r" sequences embedded in them purely by chance.
So in the standard library we use
fopen(filename, "r");
to open in text mode for reading
fopen(filename, "rb")
to open in binary mode.
O_TEXT is just an alternative interface Microsoft have provided to the
same underlying system
okay, I understand the \r\n -\n translation mechanism.
But what I do not understand is whether read and lseek values are bytes
offset or character offset.
If you read 4096 bytes which contain 3900 translated characters, will
read return 4096 or 3900? what's about lseek?
jacob navia a écrit :
O_TEXT wrote:
>When opening a file with open and O_TEXT, in microsoft environment, and then reading it with read, it is done in text mode.
What does text mode exactly mean?
How is it handled in reading?
How is it handled in writing?
does text mode has an impact on function returning position within the file? If yes, which one?
DO YOUR OWN HOMEWORK!
Malcom provides a better answer.
your answer is useless.
Moreover, you should learn keyboards contain a key which allow typing
non capitalized characters.
"O_TEXT" <O_****@nospam. fra écrit dans le message de news:
fh***********@b iggoron.nerim.n et...
Malcolm McLean a écrit :
>> "O_TEXT" <O_****@nospam. frwrote in message news:fh******* ****@biggoron.n erim.net...
>>When opening a file with open and O_TEXT, in microsoft environment, and then reading it with read, it is done in text mode.
What does text mode exactly mean?
How is it handled in reading?
How is it handled in writing?
does text mode has an impact on function returning position within the file? If yes, which one?
If you are printing out on an old-fashioned line printer you need to tell the printer to move down to the next line, and also to return. However if you are typing on a modern keyboard, usually the return button will automatically move the cursor to the next line. So the question is whether to represent newlines as "\n" or "\n\r". Operating systems make different choices. However ANSI C has decided that the "\n", or newline only route, will be used. So if you open a file in text mode on an "\r\n" operating system the "\r" will be silently suppressed. This is only good for files that actually represent text. Binary files might have "\n\r" sequences embedded in them purely by chance.
So in the standard library we use
fopen(filename , "r");
to open in text mode for reading
fopen(filename , "rb")
to open in binary mode.
O_TEXT is just an alternative interface Microsoft have provided to the same underlying system
okay, I understand the \r\n -\n translation mechanism.
But what I do not understand is whether read and lseek values are bytes
offset or character offset.
If you read 4096 bytes which contain 3900 translated characters, will read
return 4096 or 3900? what's about lseek?
This is highly Microsoft specific. You are referring to non standard
low-level I/O. You will get a more accurate answer from a microsoft
specific forum.
--
Chqrlie.
O_TEXT wrote:
When opening a file with open and O_TEXT, in microsoft environment, and
then reading it with read, it is done in text mode.
If you want to know about microsoft specifics, there are probably more
appropriate groups in which to ask. We tend to concentrate on the C
language as defined by the ISO standard, rather than platform-specific
features.
What does text mode exactly mean?
If O_TEXT means opening in what the standard defines as a text stream,
it means what the standard says...
How is it handled in reading?
How is it handled in writing?
The standard says that that is implementation-defined, as I understand it.
does text mode has an impact on function returning position within the
file? If yes, which one?
The standard only provides one such function - ftell() - and defines it
as producing, in effect, "opaque" data for text streams. By this I mean
that the value can be used by fseek() on the same stream but has no
externally-meaningful value.
"O_TEXT" <O_****@nospam. fra écrit dans le message de news:
fh***********@b iggoron.nerim.n et...
jacob navia a écrit :
>O_TEXT wrote:
>>When opening a file with open and O_TEXT, in microsoft environment, and then reading it with read, it is done in text mode.
What does text mode exactly mean?
How is it handled in reading?
How is it handled in writing?
does text mode has an impact on function returning position within the file? If yes, which one? DO YOUR OWN HOMEWORK!
Malcom provides a better answer.
It's Malcolm actually.
But names don't matter do they O_TEXT ?
your answer is useless.
You should begin your phrases with a capital letter.
Moreover, you should learn keyboards contain a key which allow typing non
capitalized characters.
Keyboards do not "contain" keys.
Your question is probably not homework, but it is O/S specific. It is too
bad you were rude to Jacob, for he could have given you detailed answer,
Windows being his platform of choice.
--
Chqrlie.
Charlie Gordon said:
<snip>
Your question is probably not homework, but it is O/S specific. It is
too bad you were rude to Jacob,
Yes indeed - and it was also too bad that Jacob was rude to him.
for he could have given you detailed
answer, Windows being his platform of choice.
Yes, but then C is his language of choice. Just because <foois your <bar>
of choice, that doesn't make you an expert <foo>er.
--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
"Richard Heathfield" <rj*@see.sig.in valida écrit dans le message de news: o4************* *************** **@bt.com...
Charlie Gordon said:
<snip>
>Your question is probably not homework, but it is O/S specific. It is too bad you were rude to Jacob,
Yes indeed - and it was also too bad that Jacob was rude to him.
>for he could have given you detailed answer, Windows being his platform of choice.
Yes, but then C is his language of choice. Just because <foois your
<bar>
of choice, that doesn't make you an expert <foo>er.
I used to waste my energy programming on DOS around these stupid Microsoft
specific text mode hacks. I even rewrote a C I/O library because I was
disgusted to see them do the \r\n translation at the low level interface
instead of just the stdio level. The benefits of bufferization were lost
because of this, as the low level I/O was not done on nice round aligned
blocks, leading to general slugishness.
I have since given up on this broken platform, and focus my development
efforts on Linux, only occasionally porting stuff to MingW or Cygwin.
Jacob makes a Windows based C compiler. He is certainly more up to date on
this issue than I am, and more an expert at it than most regulars on this
forum. Your constant bashing of his abilities is tiresome and provocative.
He makes mistakes, you make mistakes, I make mistakes, we all do, both on
technical issues and on communication skills. We are all on the same side
here, defending our language of choice, let's reserve our attacks for all
the crud out there that deserves it: java and C++ bloatware from all the big
names, MSFT and ORCL leading the pack...
--
Chqrlie. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Novice |
last post by:
Hi all, I am a C++ and Java developer with over 3 years of industry
experience. I've written low level C++ code, in addition to web
clients that use web services. I've just recently installed the
Visual Studio .net Professional trial version 2003. I have been
reading up various documents that discuss - "What is Microsoft .Net"
and have found some enlightening information.
I'm trying to write a paper on security and software...
|
by: Jim Hubbard |
last post by:
It seems that Microsoft not only does not need the classic Visual Basic
developer army (the largest army of developers the world has ever seen), but
now they don't need ANY Windows developer at a small or mid-sized business.
http://groups-beta.google.com/group/microsoft.public.msdn.general/browse_thread/thread/9d7e8f9a00c1c7da/459ca99eb0e7c328?q=%22Proposed+MSDN+subscription+changes%22&rnum=1#459ca99eb0e7c328
Damn! To be that...
|
by: Jim Hubbard |
last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
|
by: Shadow Lynx |
last post by:
At the bottom of the default Error page that appears when Unhandled
Exceptions occur, what exactly is the difference between the "Microsoft
..Net Framework Version" and the "ASP.NET Version"?
I understand that the ASP.Net version is the version of ASP.Net that
the current site is running under and it can be retreived with
System.Environment.Version.ToString.
What exactly is the Microsoft .NET Framework Version that is displayed?
It is...
|
by: fiona |
last post by:
Innovasys Ltd., a leader in help authoring and documentation tools,
today announced the inclusion of a tailored version of the Innovasys
HelpStudio help authoring product, HelpStudio Lite, in the Microsoft
Visual Studio 2005 Software Development Kit. By providing a full help
authoring environment within the Visual Studio 2005 SDK, Innovasys is
providing developers building components and products that integrate
with Visual Studio 2005 a...
| |
by: Peter Olcott |
last post by:
Does JavaScript represent its controls internally as Microsoft Windows controls,
or does it build them from scratch like Java?
|
by: scsharma |
last post by:
Hi,
I am building a .net 1.1 application with microsoft webcontrols. The
environment that i am deploying this application has 1.1 and 2.0 framework .
My development environment also has these environment side by side. Every
thing works fine on my development machine but on staging area i am have
problem with microsoft webcontrol.
I have downloaded and installed microsoft webcontrols and followed every
step in the readme.txt file but when...
|
by: Max2006 |
last post by:
Hi,
I am using ActiveDirectoryMembershipProvider for authentication. In my
development environment I don't have any Active Directory available for
development and test. Basically my development environment is a windows xp
laptop.
I am trying to avoid running a domain controller on my laptop. What would
be the easiest way to develop and test my application without running a
domain controller on my laptop?
|
by: =?Utf-8?B?SGVsZW4gVHJpbQ==?= |
last post by:
I am developing a web application in Visual Studio 2003, .NET 1.1 to run on
our intranet. I want to identify users to save them logging in.
The line:
UserName = Environment.UserName
is returning "ASPNET", instead of my user name.
I have read all the Help documentation, but I can't find any reason why this
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |