WG15 Defect Report Ref: 9945-1-59
Topic: unlink() vs remove()


This is an approved interpretation of 9945-1:1990.

.

Last update: 1997-05-20


                                                                9945-1-90 #59
        Classification: No Change.

There are some proposed changes arising for POSIX 13210 (test methods)
which are appended at the end of this text. These should be forwarded
to the test methods working group and/or project editor.
 _____________________________________________________________________________


	Topic:			unlink() vs remove()
	Relevant Sections:	5.5


Defect Report:
-----------------------

                 Does ISO/IEC 9945-1:1990 require that the ISO C remove()
                 function be effective when the filename argument
                 is not a regular file?  The question arises
                 because several filename resolution assertions in
                 13210:1994 can be tested only if remove() is
                 effective when filename is a directory.

                 My reading is that neither ISO/IEC 9945-1:1990 nor ISO C
                 makes any specific requirements.  The rationale
                 for remove() in ISO C notes that remove is
                 intended to be a portable replacement for the UNIX
                 (now POSIX.1, too) unlink() function.  A
                 conforming implementation might implement remove()
                 as a simple call to unlink().  However, I think
                 that an implementation of remove() that fails when
                 the argument is not the name of a regular file is
                 also conforming.


WG15 response for ISO/IEC 9945-1:1990 (IEEE Std 1003.1-1990)
--------------------------------------------------

The behavior for file types other than regular files is unspecified.

Rationale for Interpretation:
-----------------------------

There is no requirement in ISO/IEC 9945-1:1990 for remove() to succeed
on file types other than regular file.


Editorial note for 13210 Project editor
----------------------------------------


  The proposed changes to ISO/IEC 13210:1994 are as follows:

    Changes to remove() assertions 9 and 10, (8.1.33.4, lines 2047 and 2050)
	Replace "(A)" with "(C) If remove() supports directory file types:"

 _____________________________________________________________________________