Portability regarding sizeof() function

C

CBFalconer

Keith said:
So set the file's permissions to read-only.

As a general precaution that doesn't work on Winders or MS-DOS.
The reason is that various manufacturers (Borland is one)
arbitrarily open files for read in read-write mode, and this fails
miserably. If you are using Borland compilers, and know about it,
you can compensate. If not, tough.
 
C

CBFalconer

Richard said:
CBFalconer said:

To find out why you are mistaken, ask in newsgroups devoted to
the particular operating systems you mentioned.

You seem to have reading difficulties. I didn't ask, I advised.
You also failed miserably to mark the snippage, which explained why
'that doesn't work'. Get a good nights sleep.
 
K

Keith Thompson

CBFalconer said:
You seem to have reading difficulties. I didn't ask, I advised.

He didn't say you asked. He advised you to ask.
You also failed miserably to mark the snippage, which explained why
'that doesn't work'. Get a good nights sleep.

What you wrote was:
| As a general precaution that doesn't work on Winders or MS-DOS.
| The reason is that various manufacturers (Borland is one)
| arbitrarily open files for read in read-write mode, and this fails
| miserably. If you are using Borland compilers, and know about it,
| you can compensate. If not, tough.

The file in question was a copy of a draft of the C standard, not
something that would be opened using a Borland compiler or any other
compiler.

I'll have to take your word for it that some applications open files
that they don't intend to modify in read-write mode, and fail if the
file doesn't have write permission. I've never encountered such a
thing myself. If nothing else, setting an input file's permissions to
read-only could be a good way to flush out such applications.

But upthread, Richard Heathfield said that he had a bad habit of
"reading the Standard with vim, rather than less". vim and less are
originally Unix applications, but versions are available for Windows.
vim in particular is perfectly capable of opening a read-only file.
Setting the file's permissions to read-only certainly would solve the
problem of accidentally modifying it with vim.
 
C

CBFalconer

Keith said:
He didn't say you asked. He advised you to ask.
.... snip ...

What you wrote was:
| As a general precaution that doesn't work on Winders or MS-DOS. ^^^^^^^^^^^^^^^^^^
| The reason is that various manufacturers (Borland is one)
| arbitrarily open files for read in read-write mode, and this fails
| miserably. If you are using Borland compilers, and know about it,
| you can compensate. If not, tough.

Note underlining.
 
P

Phil Carmody

CBFalconer said:
Note underlining.


The C standard makes no mention of underlining. You are therefore
off-topic. Please take your comments about underlining to somewhere
more suitable such as alt.markup.underlining .

HAND,
Phil
 

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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top