remove in UNIX and ANSI C 
Author Message
 remove in UNIX and ANSI C

Hi,

 I have to make a CGI in C for a UNIX station but we don't have UNIX
 at the office and I never used UNIX in the past (or let say 3 weeks..
 10 years ago). I would like to compile an ANSI C file with Visual C++
 and ship the source code to the webmaster in Toronto , but I don't
 know if there's an equivalent for the remove(filename) function
 in either ANSI C or either in the UNIX toolkit (and if so, ehat is
 the include file?)

 Also, is there something available on the web, a free compiler or
either a table with functions that can allow me to check if each
 function is really ANSI C?

 If someone has the answer, please email it to me also.



Tue, 04 Apr 2000 03:00:00 GMT  
 remove in UNIX and ANSI C

int remove(const char *filename) is stdio.h



| Hi,
|
|  I have to make a CGI in C for a UNIX station but we don't have UNIX
|  at the office and I never used UNIX in the past (or let say 3 weeks..
|  10 years ago). I would like to compile an ANSI C file with visual C++
|  and ship the source code to the webmaster in Toronto , but I don't
|  know if there's an equivalent for the remove(filename) function
|  in either ANSI C or either in the UNIX toolkit (and if so, ehat is
|  the include file?)
|
|  Also, is there something available on the web, a free compiler or
| either a table with functions that can allow me to check if each
|  function is really ANSI C?
|
|  If someone has the answer, please email it to me also.
|



Tue, 04 Apr 2000 03:00:00 GMT  
 remove in UNIX and ANSI C



Quote:
> Hi,

>  I have to make a CGI in C for a UNIX station but we don't
have UNIX
>  at the office and I never used UNIX in the past (or let say 3
weeks..
>  10 years ago). I would like to compile an ANSI C file with
visual C++
>  and ship the source code to the webmaster in Toronto , but I
don't
>  know if there's an equivalent for the remove(filename)
function
>  in either ANSI C or either in the UNIX toolkit (and if so,
ehat is
>  the include file?)

>  Also, is there something available on the web, a free
compiler or
> either a table with functions that can allow me to check if
each
>  function is really ANSI C?

>  If someone has the answer, please email it to me also.

Hi Jean-Francois,

First, remove(const char *filename) is ANSI/ISO standard and
should be available on all implementations.  It is also part of
the POSIX standard, but not present on some older Unix systems.

The definition states that the function returns 0 if successful
and non zero if it fails.  Using the function on a file you have
open results in implementation-defined behavior.  A successful
result means that you cannot open that file with that name
afterwards.  It does not guarantee that the file is actually
removed from the file system, because the file system belongs to
the operating system and is beyond the control of the language.

The standard document is not available on line, as the standards
organizations sell them for revenue.  You could your national
standards body (in USA it is ANSI) to buy a copy of the
standard.  ANSI sells it for about $130.00 US.

There are commercial books you could buy, which I can recommend,
which will identify all standard library functions and other
issues about standard C:

Standard C, A Reference
P.J. Plaugher and Jim Brodie
ISBN 0-13-436411-2

C, A Reference Manual
Samuel P. Harrison and Guy L. Steele, Jr.
ISBN 0-13-326224-3

You can also buy
The Annotated ANSI C Standard
Herbert Schildt
ISBN 0-07-881952-0

But be warned that there is a missing page in the standard
itself, and many errors in Schildt's annotations (of course you
don't have to read his annotations).

In your situation, if you will be dealing a lot with remote Unix
systems, you might want to buy
POSIX Programmers Guide
Donald Lewine
ISBN 0-937175-73-0

This lists every standard C and POSIX library function (and
indicates which is which), and contains suggestions for porting
to/from older, non-POSIX versions of Unix.

Jack



Wed, 05 Apr 2000 03:00:00 GMT  
 remove in UNIX and ANSI C



Quote:
>First, remove(const char *filename) is ANSI/ISO standard and
>should be available on all implementations.  It is also part of
>the POSIX standard, but not present on some older Unix systems.

#ifndef __STDC__
#define remove(f)       unlink(f)
#endif


Wed, 05 Apr 2000 03:00:00 GMT  
 remove in UNIX and ANSI C

Quote:

> Hi,
>  I have to make a CGI in C for a UNIX station but we don't have UNIX
>  at the office and I never used UNIX in the past (or let say 3 weeks..
>  10 years ago). I would like to compile an ANSI C file with visual C++
>  and ship the source code to the webmaster in Toronto , but I don't
>  know if there's an equivalent for the remove(filename) function
>  in either ANSI C or either in the UNIX toolkit (and if so, ehat is
>  the include file?)

remove() is a Standard function and every conforming implementation must
have it.  What you need to do is get a list of the Standard headers, any
funtion listed in a standard header is probably a standard function.

Quote:
>  Also, is there something available on the web, a free compiler or
> either a table with functions that can allow me to check if each
>  function is really ANSI C?

Try:
http://www.dinkumware.com/htm_cl/index.html

Freeware Compilers
Lcc-win32:
http://www.geocities.com/SiliconValley/Heights/9069/index.html
Cygnus Gnu C for win32:
http://www.cygnus.com/misc/gnu-win32/
Delorie DJGPP port for Gnu C for extended DOS
http://www.delorie.com
Where to get Linux
http://www.ssc.com/linux/ftp.html

C Programming `Net Resources
C-FAQ ftp sites: ftp://ftp.eskimo.com
                 ftp://rtfm.mit.edu
Hypertext C-FAQ: http://www.eskimo.com/~scs/C-faq/top.html
http://www.cit.ac.nz/smac/cprogram/cstart.htm
http://www.angelfire.com/sc/electron/
http://www.cm.cf.ac.uk/Dave/C/CE.html
http://www.lysator.liu.se/c/
http://www-isis.ecs.soton.ac.uk/computing/c/notes/tao.html
http://www.cast.msstate.edu/~billy/c-prog.html

Quote:
>  If someone has the answer, please email it to me also.

--
A definition is embodied by what it defines.
A definition that defines nothing is not a definition.
A definition that has no example, defines nothing.
A definition is designed to facilitate communication.
*********************************************************
Man is still the most extraordinary computer of all.
                                    John F. Kennedy
*********************************************************

*        Remove the _JUNK_ when replying to me.         *
*********************************************************
You can't use void main() I have a patent on it!


Wed, 05 Apr 2000 03:00:00 GMT  
 remove in UNIX and ANSI C

On Fri, 17 Oct 1997 23:38:44 -0400, Jean-Francois Beaulieu

[...]

First of all: remove() is an ANSI C standard library function declared
in stdio.h.

Quote:
> Also, is there something available on the web, a free compiler or
>either a table with functions that can allow me to check if each
> function is really ANSI C?

Doesn't VC++ come along with documentation? Every good compiler's
documentation also remarks to which standard ( or none ) a function
belongs.

ByE, MarKus.

( To reply by e-mail remove the 'R' in my e-mail address )



Thu, 06 Apr 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Newbie: separate big .cs file into small .cs files

2. remove file using UNIX on C

3. A portable way to remove globals on UNIX

4. Translating Microsoft C 5.0 -> ANSI C (UNIX)

5. ** UNIX ANSI C -- Retuning an IP address **** TIA!

6. Porting C ANSI Between Unix and Windows NT

7. Sockets programming in UNIX w/ANSI C

8. _setmode() equivalent under UNIX / ANSI C?

9. Unix C to ANSI C conversion tool

10. Help on printing barcode using ANSI C under Digital UNIX

11. Menu on unix using ANSI C standard

 

 
Powered by phpBB® Forum Software