Un outil pour savoir si une commande est posix - retour accueil
git clone git://bebou.netlib.re/isposix
Log | Files | Refs | README |
rmdir.html (10226B)
1 <!-- Copyright 2001-2024 IEEE and The Open Group, All Rights Reserved --> 2 <!DOCTYPE HTML> 3 <html lang="en"> 4 <head> 5 <meta name="generator" content="HTML Tidy for HTML5 for Linux version 5.8.0"> 6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 7 <link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group rhtm tool v1.2.4 --> 8 <!-- Copyright (c) 2001-2024 The Open Group, All Rights Reserved --> 9 <title>rmdir</title> 10 </head> 11 <body bgcolor="white"> 12 <div class="NAVHEADER"> 13 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 14 <tr class="nav"> 15 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/rmdel.html" accesskey="P"><<< 16 Previous</a></td> 17 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 18 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/sact.html" accesskey="N">Next >>></a></td> 19 </tr> 20 </table> 21 <hr align="left" width="100%"></div> 22 <script language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> 23 <center><font size="2">The Open Group Base Specifications Issue 8<br> 24 IEEE Std 1003.1-2024<br> 25 Copyright © 2001-2024 The IEEE and The Open Group</font></center> 26 <hr size="2" noshade> 27 <a name="top" id="top"></a> <a name="rmdir" id="rmdir"></a> <a name="tag_20_106" id="tag_20_106"></a><!-- rmdir --> 28 <h4 class="mansect"><a name="tag_20_106_01" id="tag_20_106_01"></a>NAME</h4> 29 <blockquote>rmdir — remove directories</blockquote> 30 <h4 class="mansect"><a name="tag_20_106_02" id="tag_20_106_02"></a>SYNOPSIS</h4> 31 <blockquote class="synopsis"> 32 <p><code><tt>rmdir</tt> <b>[</b><tt>-p</tt><b>]</b> <i>dir</i><tt>...</tt></code></p> 33 </blockquote> 34 <h4 class="mansect"><a name="tag_20_106_03" id="tag_20_106_03"></a>DESCRIPTION</h4> 35 <blockquote> 36 <p>The <i>rmdir</i> utility shall remove the directory entry specified by each <i>dir</i> operand.</p> 37 <p>For each <i>dir</i> operand, the <i>rmdir</i> utility shall perform actions equivalent to the <a href= 38 "../functions/rmdir.html"><i>rmdir</i>()</a> function called with the <i>dir</i> operand as its only argument.</p> 39 <p>Directories shall be processed in the order specified. If a directory and a subdirectory of that directory are specified in a 40 single invocation of the <i>rmdir</i> utility, the application shall specify the subdirectory before the parent directory so that 41 the parent directory is empty when the <i>rmdir</i> utility tries to remove it.</p> 42 </blockquote> 43 <h4 class="mansect"><a name="tag_20_106_04" id="tag_20_106_04"></a>OPTIONS</h4> 44 <blockquote> 45 <p>The <i>rmdir</i> utility shall conform to XBD <a href="../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax 46 Guidelines</i></a> .</p> 47 <p>The following option shall be supported:</p> 48 <dl compact> 49 <dd></dd> 50 <dt><b>-p</b></dt> 51 <dd>Remove all directories in a pathname. For each <i>dir</i> operand: 52 <ol> 53 <li> 54 <p>The directory entry it names shall be removed.</p> 55 </li> 56 <li> 57 <p>If the <i>dir</i> operand includes more than one pathname component, effects equivalent to the following command shall 58 occur:</p> 59 <pre> 60 <tt>rmdir -p $(dirname </tt><i>dir</i><tt>) 61 </tt></pre></li> 62 </ol> 63 </dd> 64 </dl> 65 </blockquote> 66 <h4 class="mansect"><a name="tag_20_106_05" id="tag_20_106_05"></a>OPERANDS</h4> 67 <blockquote> 68 <p>The following operand shall be supported:</p> 69 <dl compact> 70 <dd></dd> 71 <dt><i>dir</i></dt> 72 <dd>A pathname of an empty directory to be removed.</dd> 73 </dl> 74 </blockquote> 75 <h4 class="mansect"><a name="tag_20_106_06" id="tag_20_106_06"></a>STDIN</h4> 76 <blockquote> 77 <p>Not used.</p> 78 </blockquote> 79 <h4 class="mansect"><a name="tag_20_106_07" id="tag_20_106_07"></a>INPUT FILES</h4> 80 <blockquote> 81 <p>None.</p> 82 </blockquote> 83 <h4 class="mansect"><a name="tag_20_106_08" id="tag_20_106_08"></a>ENVIRONMENT VARIABLES</h4> 84 <blockquote> 85 <p>The following environment variables shall affect the execution of <i>rmdir</i>:</p> 86 <dl compact> 87 <dd></dd> 88 <dt><i>LANG</i></dt> 89 <dd>Provide a default value for the internationalization variables that are unset or null. (See XBD <a href= 90 "../basedefs/V1_chap08.html#tag_08_02"><i>8.2 Internationalization Variables</i></a> for the precedence of internationalization 91 variables used to determine the values of locale categories.)</dd> 92 <dt><i>LC_ALL</i></dt> 93 <dd>If set to a non-empty string value, override the values of all the other internationalization variables.</dd> 94 <dt><i>LC_CTYPE</i></dt> 95 <dd>Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as 96 opposed to multi-byte characters in arguments).</dd> 97 <dt><i>LC_MESSAGES</i></dt> 98 <dd><br> 99 Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.</dd> 100 <dt><i>NLSPATH</i></dt> 101 <dd><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> 102 Determine the location of messages objects and message catalogs. <img src="../images/opt-end.gif" alt="[Option End]" border= 103 "0"></dd> 104 </dl> 105 </blockquote> 106 <h4 class="mansect"><a name="tag_20_106_09" id="tag_20_106_09"></a>ASYNCHRONOUS EVENTS</h4> 107 <blockquote> 108 <p>Default.</p> 109 </blockquote> 110 <h4 class="mansect"><a name="tag_20_106_10" id="tag_20_106_10"></a>STDOUT</h4> 111 <blockquote> 112 <p>Not used.</p> 113 </blockquote> 114 <h4 class="mansect"><a name="tag_20_106_11" id="tag_20_106_11"></a>STDERR</h4> 115 <blockquote> 116 <p>The standard error shall be used only for diagnostic messages.</p> 117 </blockquote> 118 <h4 class="mansect"><a name="tag_20_106_12" id="tag_20_106_12"></a>OUTPUT FILES</h4> 119 <blockquote> 120 <p>None.</p> 121 </blockquote> 122 <h4 class="mansect"><a name="tag_20_106_13" id="tag_20_106_13"></a>EXTENDED DESCRIPTION</h4> 123 <blockquote> 124 <p>None.</p> 125 </blockquote> 126 <h4 class="mansect"><a name="tag_20_106_14" id="tag_20_106_14"></a>EXIT STATUS</h4> 127 <blockquote> 128 <p>The following exit values shall be returned:</p> 129 <dl compact> 130 <dd></dd> 131 <dt> 0</dt> 132 <dd>Each directory entry specified by a <i>dir</i> operand was removed successfully.</dd> 133 <dt>>0</dt> 134 <dd>An error occurred.</dd> 135 </dl> 136 </blockquote> 137 <h4 class="mansect"><a name="tag_20_106_15" id="tag_20_106_15"></a>CONSEQUENCES OF ERRORS</h4> 138 <blockquote> 139 <p>Default.</p> 140 </blockquote> 141 <hr> 142 <div class="box"><em>The following sections are informative.</em></div> 143 <h4 class="mansect"><a name="tag_20_106_16" id="tag_20_106_16"></a>APPLICATION USAGE</h4> 144 <blockquote> 145 <p>The definition of an empty directory is one that contains, at most, directory entries for dot and dot-dot.</p> 146 </blockquote> 147 <h4 class="mansect"><a name="tag_20_106_17" id="tag_20_106_17"></a>EXAMPLES</h4> 148 <blockquote> 149 <p>If a directory <b>a</b> in the current directory is empty except it contains a directory <b>b</b> and <b>a/b</b> is empty except 150 it contains a directory <b>c</b>:</p> 151 <pre> 152 <tt>rmdir -p a/b/c 153 </tt></pre> 154 <p>removes all three directories.</p> 155 </blockquote> 156 <h4 class="mansect"><a name="tag_20_106_18" id="tag_20_106_18"></a>RATIONALE</h4> 157 <blockquote> 158 <p>On historical System V systems, the <b>-p</b> option also caused a message to be written to the standard output. The message 159 indicated whether the whole path was removed or whether part of the path remained for some reason. The STDERR section requires this 160 diagnostic when the entire path specified by a <i>dir</i> operand is not removed, but does not allow the status message reporting 161 success to be written as a diagnostic.</p> 162 <p>The <i>rmdir</i> utility on System V also included a <b>-s</b> option that suppressed the informational message output by the 163 <b>-p</b> option. This option has been omitted because the informational message is not specified by this volume of 164 POSIX.1-2024.</p> 165 </blockquote> 166 <h4 class="mansect"><a name="tag_20_106_19" id="tag_20_106_19"></a>FUTURE DIRECTIONS</h4> 167 <blockquote> 168 <p>None.</p> 169 </blockquote> 170 <h4 class="mansect"><a name="tag_20_106_20" id="tag_20_106_20"></a>SEE ALSO</h4> 171 <blockquote> 172 <p><a href="../utilities/rm.html#"><i>rm</i></a></p> 173 <p>XBD <a href="../basedefs/V1_chap08.html#tag_08"><i>8. Environment Variables</i></a> , <a href= 174 "../basedefs/V1_chap12.html#tag_12_02"><i>12.2 Utility Syntax Guidelines</i></a></p> 175 <p>XSH <a href="../functions/remove.html#"><i>remove</i></a> , <a href="../functions/rmdir.html#tag_17_493"><i>rmdir</i></a> , 176 <a href="../functions/unlink.html#tag_17_649"><i>unlink</i></a></p> 177 </blockquote> 178 <h4 class="mansect"><a name="tag_20_106_21" id="tag_20_106_21"></a>CHANGE HISTORY</h4> 179 <blockquote> 180 <p>First released in Issue 2.</p> 181 </blockquote> 182 <h4 class="mansect"><a name="tag_20_106_22" id="tag_20_106_22"></a>Issue 6</h4> 183 <blockquote> 184 <p>The normative text is reworded to avoid use of the term "must" for application requirements.</p> 185 </blockquote> 186 <h4 class="mansect"><a name="tag_20_106_23" id="tag_20_106_23"></a>Issue 8</h4> 187 <blockquote> 188 <p>Austin Group Defect 1122 is applied, changing the description of <i>NLSPATH .</i></p> 189 </blockquote> 190 <div class="box"><em>End of informative text.</em></div> 191 <hr> 192 <p> </p> 193 <a href="#top"><span class="topOfPage">return to top of page</span></a><br> 194 <hr size="2" noshade> 195 <center><font size="2">UNIX® is a registered Trademark of The Open Group.<br> 196 POSIX™ is a Trademark of The IEEE.<br> 197 Copyright © 2001-2024 The IEEE and The Open Group, All Rights Reserved<br> 198 [ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href= 199 "../functions/contents.html">XSH</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../xrat/contents.html">XRAT</a> 200 ]</font></center> 201 <hr size="2" noshade> 202 <div class="NAVHEADER"> 203 <table summary="Header navigation table" class="nav" width="100%" border="0" cellpadding="0" cellspacing="0"> 204 <tr class="nav"> 205 <td class="nav" width="15%" align="left" valign="bottom"><a href="../utilities/rmdel.html" accesskey="P"><<< 206 Previous</a></td> 207 <td class="nav" width="70%" align="center" valign="bottom"><a href="contents.html">Home</a></td> 208 <td class="nav" width="15%" align="right" valign="bottom"><a href="../utilities/sact.html" accesskey="N">Next >>></a></td> 209 </tr> 210 </table> 211 <hr align="left" width="100%"></div> 212 </body> 213 </html>