473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

What is the meaning of 'wt' in utf8_fopen

Hi,

Can you please tell me what is the mean of 't' in the input parametre
in utf8_fopen?

utf8_fopen( a_file, "wt" )

Thank you.

May 23 '07 #1
10 13546
si***************@gmail.com wrote:
Can you please tell me what is the mean of 't' in the input parametre
in utf8_fopen?

utf8_fopen( a_file, "wt" )
Not sure what the heck 'utf8_fopen' is, but in 'fopen' "wt" means
open for Write in Text mode.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
May 23 '07 #2
Victor Bazarov wrote:
si***************@gmail.com wrote:
Can you please tell me what is the mean of 't' in the input
parametre in utf8_fopen?

utf8_fopen( a_file, "wt" )

Not sure what the heck 'utf8_fopen' is, but in 'fopen' "wt" means
open for Write in Text mode.
No, it's undefined.

From the C draft standard:
7.19.5.3 The fopen function

Synopsis

[#1]

#include <stdio.h>
FILE *fopen(const char * filename,
const char * mode);
[#3] The argument mode points to a string. If the string is
one of the following, the file is open in the indicated
mode. Otherwise, the behavior is undefined.214)

r open text file for reading
w truncate to zero length or create text file for writing
a append; open or create text file for writing at end-of-
file
rb open binary file for reading
wb truncate to zero length or create binary file for
writing
ab append; open or create binary file for writing at end-
of-file
r+ open text file for update (reading and writing)
w+ truncate to zero length or create text file for update
a+ append; open or create text file for update, writing at
end-of-file
r+b or rb+ open binary file for update (reading and writing)
w+b or wb+ truncate to zero length or create binary file for update
a+b or ab+ append; open or create binary file for update, writing
at end-of-file
214If the string begins with one of the above sequences, the
implementation might choose to ignore the remaining
characters, or it might use them to select different
kinds of a file (some of which might not conform to the
properties in 7.19.2).

Brian
May 23 '07 #3
Default User wrote:
Victor Bazarov wrote:
>si***************@gmail.com wrote:
>>Can you please tell me what is the mean of 't' in the input
parametre in utf8_fopen?

utf8_fopen( a_file, "wt" )

Not sure what the heck 'utf8_fopen' is, but in 'fopen' "wt" means
open for Write in Text mode.

No, it's undefined.

From the C draft standard:
[..]
Whatever. The "wt" still looks very much like
"open for WRITE in TEXT mode".

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
May 23 '07 #4
On May 23, 11:55 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
Default User wrote:
Victor Bazarov wrote:
silverburgh.me...@gmail.com wrote:
Can you please tell me what is the mean of 't' in the input
parametre in utf8_fopen?
>utf8_fopen( a_file, "wt" )
Not sure what the heck 'utf8_fopen' is, but in 'fopen' "wt" means
open for Write in Text mode.
No, it's undefined.
From the C draft standard:
[..]
Whatever. The "wt" still looks very much like
"open for WRITE in TEXT mode".
But who cares what it looks like. "wt" is undefined behavior
when passed to fopen. A quick search on the net turned up several
different utf8_fopen; it's also undefined behavior in at least
several of them.

Text mode is signaled by the absense of a "b" in the mode, not
by the presense of anything else.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

May 24 '07 #5
James Kanze wrote:
On May 23, 11:55 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
>Default User wrote:
>>Victor Bazarov wrote:
>>>silverburgh.me...@gmail.com wrote:
Can you please tell me what is the mean of 't' in the input
parametre in utf8_fopen?
>>>>utf8_fopen( a_file, "wt" )
>>>Not sure what the heck 'utf8_fopen' is, but in 'fopen' "wt" means
open for Write in Text mode.
>>No, it's undefined.
>>From the C draft standard:
[..]
>Whatever. The "wt" still looks very much like
"open for WRITE in TEXT mode".

But who cares what it looks like. "wt" is undefined behavior
when passed to fopen. A quick search on the net turned up several
different utf8_fopen; it's also undefined behavior in at least
several of them.

Text mode is signaled by the absense of a "b" in the mode, not
by the presense of anything else.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Well, in Microsoft implementations the 't' can be used to specify text
mode. In libraries and dll's it is good practice because the other parts
can change the default filemode with globa (yikes) _fmode or using
binmode.obj with linker.

But in any case the utf8_open is not part of standard so this
discussion is OT here.

ismo

May 24 '07 #6
Victor Bazarov wrote:
Default User wrote:
Victor Bazarov wrote:
si***************@gmail.com wrote:
Can you please tell me what is the mean of 't' in the input
parametre in utf8_fopen?

utf8_fopen( a_file, "wt" )
>
Not sure what the heck 'utf8_fopen' is, but in 'fopen' "wt" means
open for Write in Text mode.
No, it's undefined.

From the C draft standard:
[..]

Whatever. The "wt" still looks very much like
"open for WRITE in TEXT mode".
Perhaps it does, but it isn't. You of all people should appreciate the
difference between "what is" and "what looks like".


Brian
May 24 '07 #7
Default User wrote:
Victor Bazarov wrote:
>Default User wrote:
>>Victor Bazarov wrote:

si***************@gmail.com wrote:
Can you please tell me what is the mean of 't' in the input
parametre in utf8_fopen?
>
utf8_fopen( a_file, "wt" )

Not sure what the heck 'utf8_fopen' is, but in 'fopen' "wt" means
open for Write in Text mode.

No, it's undefined.

From the C draft standard:
[..]

Whatever. The "wt" still looks very much like
"open for WRITE in TEXT mode".

Perhaps it does, but it isn't. You of all people should appreciate the
difference between "what is" and "what looks like".
How do you know it _isn't_? What's 'utf8_fopen'? I don't know such
function. I speculated (implicitly) that it is akin to 'fopen', which
has similar arguments. I incorrectly recalled that 'fopen' allows the
second argument to be "wt". It does NOT preclude 'utf8_fopen' to allow
"wt" which DOES look like "open for WRITE in TEXT mode".

More objections?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
May 24 '07 #8
Victor Bazarov wrote:
Default User wrote:
Victor Bazarov wrote:
Default User wrote:
Victor Bazarov wrote:

si***************@gmail.com wrote:
Can you please tell me what is the mean of 't' in the input
parametre in utf8_fopen?

utf8_fopen( a_file, "wt" )
>
Not sure what the heck 'utf8_fopen' is, but in 'fopen' "wt"
means open for Write in Text mode.

No, it's undefined.

From the C draft standard:
[..]
>
Whatever. The "wt" still looks very much like
"open for WRITE in TEXT mode".
Perhaps it does, but it isn't. You of all people should appreciate
the difference between "what is" and "what looks like".

How do you know it isn't? What's 'utf8_fopen'? I don't know such
function. I speculated (implicitly) that it is akin to 'fopen', which
has similar arguments. I incorrectly recalled that 'fopen' allows the
second argument to be "wt". It does NOT preclude 'utf8_fopen' to
allow "wt" which DOES look like "open for WRITE in TEXT mode".
I'm unconcerned about utf8_fopen() because it's nonstandard. I have no
opinion about what "wt" or any other argument may or may not do. And in
fact, I never addressed it, and you know that. I corrected your error
about fopen().

I'm not sure why you're being so pissy about this. You spend a good bit
of your time here correcting other people's mistakes, some less
egregious than yours. I'd have expected a bit more graciousness on your
part. Something akin to, "thanks for the information", not, "whatever".


Brian

May 24 '07 #9
Default User wrote:
[..moan moan..]
Thanks for the information.
May 24 '07 #10
Victor Bazarov wrote:
Default User wrote:
[..moan moan..]

Thanks for the information.

I'm sorry you feel so put upon by a simple correction of your mistake.
You know, the FAQ doesn't say anything about Victor Bazarov always
being right, or if he's wrong it not being important.

I'm sure you'll take it in stride next time someone is rude and
ungracious when you point out one of their errors.


Brian
May 24 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

112
by: Andy | last post by:
Hi All! We are doing new development for SQL Server 2000 and also moving from SQL 7.0 to SQL Server 2000. What are cons and pros for using IDENTITY property as PK in SQL SERVER 2000? Please,...
10
by: Mary Ellen Curtin | last post by:
arrgh. Because I can't afford a new system right now, I'm running a hamster-powered Pentium 166, 64 M RAM, Win 95. I've been using Dreamweaver3, but I've now reached my limit. *rends DW3 with teeth...
2
by: Nobody | last post by:
Let me start off with a brief overview... This part is not really important, just saying what its for... I had been working on a Windows GUI library (DLL) when suddenly my boss told he wanted...
2
by: Jon Slaughter | last post by:
This has wasted about 4 hours of my time to narrow this stupid thing down and I have no clue to why its screwing up. The problem is, I'm trying to write a file and if I mess with the data array...
17
by: candy_init | last post by:
I sometimes comes across statements which invloves the use of size_t.But I dont know exactly that what is the meaning of size_t.What I know about it is that it is used to hide the platform...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Languageâ€, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
132
by: Frederick Gotham | last post by:
If we look at a programming language such as C++: When an updated Standard comes out, everyone adopts it and abandons the previous one. It seems though that things aren't so clear-cut in the C...
7
by: rich | last post by:
I am trying to setup a set of radio buttons from a table. I am getting the error: Parse error: parse error, unexpected ' ." type=". $typ ."/>". getnormwtA .">"; $tab++; ?> } ?> This is...
4
by: Virtual_X | last post by:
it's only language confusion i am non-english speaker so i heard about stream in alot of c++ tutorials ie: in iostream and in sstream headers in sstream we use the class stringstream to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.