File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 10411041However, it is not part of SUSv4 and thus not portable, unfortunately.
10421042The portable way is to call \texttt {stat } on each directory entry.
10431043\item \texttt {rmdir } does not work on directories that are not empty. You have
1044- to remove all entries before you can delete a directory. You can use
1045- \texttt {system("rm -r xxx") } etc. but be careful to sanitize the environment and
1046- the directory name to avoid any security implications.
1044+ to remove all entries before you can delete a directory. It might be tempting
1045+ to use something like \texttt {system("rm -r xxx") }, e.g. invoke a shell to
1046+ run the \texttt {rm } command etc., however this should be avoided as it is prone
1047+ to errors (the environment and the directory name might be hard to sanitize)
1048+ and might have security implications.
10471049\item \hlabel {REMOVE} The specification also defines \texttt {remove } which
10481050behaves like \texttt {unlink } for files and as \texttt {rmdir } for directories.
10491051\end {itemize }
You can’t perform that action at this time.
0 commit comments