Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rmdir(3) [php man page]

RMDIR(3)								 1								  RMDIR(3)

rmdir - Removes directory

SYNOPSIS
bool rmdir (string $dirname, [resource $context]) DESCRIPTION
Attempts to remove the directory named by $dirname. The directory must be empty, and the relevant permissions must permit this. A E_WARN- ING level error will be generated on failure. PARAMETERS
o $dirname - Path to the directory. o $context - Note Context support was added with PHP 5.0.0. For a description of contexts, refer to "Streams". RETURN VALUES
Returns TRUE on success or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.0.0 | | | | | | | As of PHP 5.0.0 rmdir(3) can also be used with | | | some URL wrappers. Refer to "Supported Protocols | | | and Wrappers" for a listing of which wrappers | | | support rmdir(3). | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 rmdir(3) example <?php if (!is_dir('examples')) { mkdir('examples'); } rmdir('examples'); ?> NOTES
Note When safe mode is enabled, PHP checks whether the directory in which the script is operating has the same UID (owner) as the script that is being executed. SEE ALSO
is_dir(3), mkdir(3), unlink(3). PHP Documentation Group RMDIR(3)

Check Out this Related Man Page

IS_DIR(3)								 1								 IS_DIR(3)

is_dir - Tells whether the filename is a directory

SYNOPSIS
bool is_dir (string $filename) DESCRIPTION
Tells whether the given filename is a directory. PARAMETERS
o $filename - Path to the file. If $filename is a relative filename, it will be checked relative to the current working directory. If $file- name is a symbolic or hard link then the link will be resolved and checked. If you have enabled safe mode, or open_basedir further restrictions may apply. RETURN VALUES
Returns TRUE if the filename exists and is a directory, FALSE otherwise. EXAMPLES
Example #1 is_dir(3) example <?php var_dump(is_dir('a_file.txt')); var_dump(is_dir('bogus_dir/abc')); var_dump(is_dir('..')); //one dir up ?> The above example will output: bool(false) bool(false) bool(true) ERRORS
/EXCEPTIONS Upon failure, an E_WARNING is emitted. NOTES
Note The results of this function are cached. See clearstatcache(3) for more details. Tip As of PHP 5.0.0, this function can also be used with some URL wrappers. Refer to "Supported Protocols and Wrappers" to determine which wrappers support stat(3) family of functionality. SEE ALSO
chdir(3), dir(3), opendir(3), is_file(3), is_link(3). PHP Documentation Group IS_DIR(3)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

need examples?

(1 Reply)
Discussion started by: wmosley2
1 Replies

2. UNIX for Dummies Questions & Answers

Unix Equivalents to the following Dos Commands

cd... dir... rem ... type... del... copy... mkdir... rmdir... attrib... And how can I get this information? My email address is ***removed*** By way the 001 are numbers. (3 Replies)
Discussion started by: jaquar85
3 Replies

3. HP-UX

Can't delete a directory on HP-UX

Hi, I am having hard time to delete a directory: $ rm -r testoxdwdw rm: testoxdwdw non-existent $ rmdir testoxdwdw rmdir: testoxdwdw: No such file or directory $ rm -rf testoxdwdw Thanks! (2 Replies)
Discussion started by: oradbus
2 Replies

4. Shell Programming and Scripting

safe mode

Hello I'm working on a PHP project right now and when I try to run 'mkdir' I've been getting an error: code: mkdir("<full path>/test", 0700); error: PHP Warning: mkdir() : SAFE MODE Restriction in effect. The script whose uid is 10002 is not allowed to access <full path> owned by uid... (2 Replies)
Discussion started by: recluse8912
2 Replies

5. Shell Programming and Scripting

Newbie problem with simple script to create a directory

script is: dirname= "$(date +%b%d)_$(date +%H%M)" mkdir $dirname should create a directory named Nov4_ Instead I get the following returned: root@dchs-pint-001:/=>./test1 ./test1: Nov04_0736: not found. Usage: mkdir Directory ... root@dchs-pint-001:/=> TOO easy, but what am I... (2 Replies)
Discussion started by: gwfay
2 Replies

6. UNIX for Dummies Questions & Answers

Quick question...rmdir -l

Hello, We use a very basic version of unix via putty and are not experts by any means. We accidentally submitted the statement: "mkdir -l" ("dash-letter L) and a new directory was created. Putty/UNIX will now not recognize the statement "rmdir -l". When we run a "ls -l" command, it shows... (3 Replies)
Discussion started by: UDcc123
3 Replies

7. Solaris

help with command

how to remove a non-empty directory using rmdir command. (2 Replies)
Discussion started by: sudhiroracle
2 Replies

8. Windows & DOS: Issues & Discussions

PSFTP/PSCP: remotely deleting directory recursively

Hello, I'm looking for a way to use PSFTP or PSCP, executed from a batch file in Windows, to delete an entire folder and its contents. I can run a script using PSFTP which can use rm or rmdir, but the -rf command doesn't work. Any suggestions on another client to use in the same context, or a... (2 Replies)
Discussion started by: ocdcollector
2 Replies

9. Shell Programming and Scripting

Get password protected URL folder using PHP fopen function

Hi everybody, Please some help over here, I`m pretty new in PHP. I have a cronrefresh php file within a website, I need this script get infornation from a URL of the site. Part of the script where $URL variable appears is: $fdURL = mysql_query("SELECT * FROM affiliSt_config WHERE name... (2 Replies)
Discussion started by: cgkmal
2 Replies

10. Programming

Is there any possibility of running the PHP script in a debug mode ?

Is there any possibility of running the PHP script in a debug mode ? If so, do i have to download any package? Any free downloads available? Can anyone please guide me through? Am a newbie in PHP scripting. Thanks in Advance! (1 Reply)
Discussion started by: vidhyaS
1 Replies

11. UNIX for Dummies Questions & Answers

Remove the date portion from file name

hi, I am trying to remove the last field before the period (.) from a list of file names in a directory in a shell script. Below is the list of file names. ENVID_archival_20120214092258.log ENVID_Get_Source_Files_20120214091828.log ENVID_Get_Source_Files_20120214092523.log... (6 Replies)
Discussion started by: Vijay81
6 Replies

12. UNIX for Dummies Questions & Answers

Practice using Unix and lack of knowledge

So I have a Networking class at my university that involves learning the basic commands of unix (i.e. Chmod, cat, cp, ls, mv, rm, mkdir, rmdir, pwd, etc) and my professor had us download and install Solaris and PuTTY as a means of...I suppose practicing using/executing commands. However due to... (7 Replies)
Discussion started by: bo74
7 Replies

13. Shell Programming and Scripting

Simple sh called by PHP to create users HELP

Hello! Im trying to create a shell script that will be executed by PHP like: $return = shell_exec("./makeUser.sh $user $pass"); My shell script looks like: #!/bin/bash NAME=$1 PWD=$2 pass=$(perl -e 'print crypt($ARGV, "password")' $PWD) useradd -m -p $pass $NAME && echo "0" ||... (2 Replies)
Discussion started by: blak422
2 Replies

14. UNIX for Dummies Questions & Answers

What option will use for deleting directory with all its contents?

Hi How to completely delete directory with all it contents I try to use rmdir -r but it give error Thanks ---------- Post updated at 03:10 AM ---------- Previous update was at 02:52 AM ---------- Hi all I got the solution for my thread i use mkdir with the option -p Thanks (1 Reply)
Discussion started by: Tauatioti
1 Replies

15. UNIX for Dummies Questions & Answers

Why can't I delete this directory ?

Oracle Linux 6.4 bash shell I am trying to remove the directory named OPatch. I am trying to run rm and rmdir commands while logged in as grid user, the owner of the directory. But I keep getting "Permission denied" error. It is an empty directory. Any idea why I am getting 'Permission denied'... (5 Replies)
Discussion started by: kraljic
5 Replies