How to write to a file including full directory in C under Unix?

R

Richard Bos

CBFalconer said:
That is covered above by 'specific reasons'. However the program
without any mkdir will compile and execute on more systems than the
program with mkdir.

That's what you think. For mkdir, you may even be correct, because that
command happens to be called the same thing on MS-DOS as under Unix. Now
try the same thing with "dir".
That's increased portability.

Not in practice, it isn't.

Richard
 
B

Bill Reid

Sheesh, just looked at this old post, somebody musta defecated
in his scrambled eggs that morning...

Walter Roberson said:
POSIX is included in the C compilers for "many different types of
systems"?? Would I be likely to recognize the names of any of
those systems??

Sure. Think "Evil Empire"...
POSIX is the "Portable Operating System Interface". A C compiler
does not implement operating system interfaces: to do so would
take them out of the realm of being *operating system* interfaces
into the realm of being *application* entities.

Come on, you know what I meant, that either totally-conforming or
"POSIX-like" C function calls are included in some C compilers. Mine
does, but I dare not breathe the name of the "system" for fear that
Lord Gater will use his mind to choke me...
Sometimes C compilers bundle in, as extensions, header files useful
with POSIX -- but the operating system behaviours are left to
the operating system to implement, not delivered by the C compiler.

Hmmmmm, "header files", hmmmmm...all I know is that I can call
a function that does what the OP wanted to do (of course, what the OP
wanted to do is always forgotten in these "discussions") in my compiler,
because it includes a bunch of functions that have either identical
or similar signatures and usage as are specified by POSIX...
Are you aware of the following, Bill?

http://support.microsoft.com/kb/308259

POSIX and OS/2 are not supported in Windows XP or in Windows Server 2003

OMG!!! Who woulda thunk it!!?!!!

The truly hilarious thing is that if "Windows" "supported" POSIX, then
it could be legally called "Unix"!!!! And even more hilariously, "Windows"
may be more POSIX compliant than "Linux"!!!!
Overview
Utilities and SDK for UNIX-Based Applications is an add-on to the
Subsystem for UNIX-Based Applications (referred to as SUA, hence
forth) component that shipped in Microsoft Windows Vista /
Windows Server 2008 RTM. [...]

System Requirements

* Supported Operating Systems: Windows Server 2008; Windows
Vista Enterprise; Windows Vista Enterprise 64-bit edition;
Windows Vista Service Pack 1; Windows Vista Ultimate; Windows
Vista Ultimate 64-bit edition

If it was just a matter of having the right C compiler, then why
the restrictions on the supported editions? Why no support for
Vista Starter, Vista Home, Vista Home Premium, or Vista Business ?

It must be some sort of illegal monopolistic strategy, of course.

Look, you're just being argumentative for no apparent reason.
If you want to make a directory in a C program, you're gonna have
to use an "extension" of some sort. As has been discussed to
death, I think it might behoove you to use an extension that
conforms to POSIX as much as possible, for the sake of the
sacred "portability" at the source level, but if you want to use
direct calls to a system designed by the guy who killed Obi
Wan-Kenobi to each his own...
 
L

Lew Pitcher

On October 12, 2008 12:50, in comp.lang.c, Bill Reid
([email protected]) wrote something completely off-topic for
comp.lang.c:
[snip]
OMG!!! Who woulda thunk it!!?!!!

The truly hilarious thing is that if "Windows" "supported" POSIX,

What do you mean by "if"? Haven't you heard about Windows SFU (Services for
Unix)?
then it could be legally called "Unix"!!!!

Not without certification from the Open Group.

But, POSIX support is not Unix support. POSIX compliance simply gets
Microsoft past the US GAO requirement that all computer systems purchased
by US Federal agencies /must/ support POSIX. (Does that requirement still
exist?)
And even more hilariously, "Windows" may be more POSIX compliant
than "Linux"!!!!

Don't know. Don't care. Most Windows programmers do not write POSIX
applications for Windows. It matters not if Microsoft supplies a POSIX
environment for Windows, when no one uses it.

In practical terms, Linux apps are more POSIX-compliant than Windows apps,
and (unlike Windows), Linux /comes/ with POSIX compatability.


--
Lew Pitcher

Master Codewright & JOAT-in-training | Registered Linux User #112576
http://pitcher.digitalfreehold.ca/ | GPG public key available by request
---------- Slackware - Because I know what I'm doing. ------
 

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,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top