Questions tagged [rmdir]

The `rmdir` command is a Linux, DOS and Windows command used to remove a directory or folder.

The rmdir command is a Linux and Windows command used to remove a directory or folder.

Manpage for rmdir.

152 questions
0
votes
3 answers

forfiles error while deleting folders

I am trying to write a script that deletes items in the TEMP folder(s) in Windows 7. I only want it to delete files that are 30 days or older. I'm doing testing in a folder which I have set up in the system's environmental variables as TESTTEMP. I…
Mage Xy
  • 1,803
  • 30
  • 36
0
votes
1 answer

unlink or rmdir cant remove folder.only remove file in folder

i have file in upload/project1/update. the problem is,only files in update is deleted. i want to remove the directory in folder upload...thats mean,folder name 'project1' and 'update' also delete after the files in update is deleted.can u spots the…
0
votes
0 answers

PHP - Check if dir exists with starting mask

I want to check with php if a dir in my directory exist with a starting mask TEMP My temp directories looks like this: TEMP20130222001408378716 etc. $dir="mydirecrtory/*"; $dirmask="TEMP"; foreach(glob($dir/TEMP*) AS tempdir) if…
Simulator88
  • 617
  • 6
  • 12
  • 27
0
votes
2 answers

How to delete multiple directories having same prefix name?

I know that we can delete a directory with the function: rmdir($path); However I wanted to delete a set of directories having the same prefix. For example there are the directories: A_Folder1, A_Folder2, A_Folder3, B_Folder1, B_Folder2,…
Jemru
  • 2,091
  • 16
  • 39
  • 52
0
votes
2 answers

permission for folder that create with mkdir

I made a folder in PHP: mkdir('../gallery/images/G'.$result_gallery,0777,true); inside this folder are photos that users upload. when I want remove this folder or file this warning appears: Warning: rmdir(../gallery/images/G35): Permission denied…
0
votes
1 answer

PHP recursively removing folders

Here is function that I'm using for recursively deleting folders and files function rmdir_recursively($dir) { if (!is_dir($dir) || is_link($dir)) return unlink($dir); foreach (scandir($dir) as $file) { if ($file == '.' ||…
heron
  • 3,611
  • 25
  • 80
  • 148
0
votes
2 answers

Delete all directories named "XXX" from sub-directories from root directory in Windows or Unix

I have many directories with some sub-directories that need to be deleted. Is there a way to deltree/rmdir so that all directories titled "TAB", "Tab_old" and files in them are deleted. Directory structure is…
GeorgeC
  • 956
  • 5
  • 16
  • 40
-1
votes
1 answer

rd, rmdir, del what to use

Situation: x:\neededmap\files.txt x:\neededmap\trashmap1\files.txt x:\neededmap\trashmap1\trashmap2\files.txt x:\neededmap\trashmap3\files.txt x:\neededmap\trashmap4\files.txt How to delete by batch all Files.txt and all trashmaps Or better, just…
Kos
  • 1
  • 1
-1
votes
2 answers

How to delete a non-empty folder in Batch script?

I have tried numerous methods of doing this including Remove-Item, rmdir, del, and rd. I have seen similar questions, but none of the answers have helped me. To be clear, I am not asking for a specific "book, tool, or software library"; I just want…
UxuginLinux
  • 13
  • 2
  • 6
-1
votes
1 answer

how to delete directory php

I'm trying to make form to delete chosen option which is subdirectory in images directory. I have a function which removes all files in subfolder and then a whole subfolder but when I call it, nothing happens. Can someone help me? Here's my html…
cherryBom
  • 53
  • 1
  • 6
-1
votes
3 answers

Delete folder and all inside contents function returns "directory not empty"

Below is my attempt to delete a folder and all its content. A folder may contain zip files and folders with files. public function deleteFolder($dir){ if(file_exists($dir)){ $it = new \RecursiveDirectoryIterator($dir,…
Juliver Galleto
  • 8,831
  • 27
  • 86
  • 164
-1
votes
1 answer

How can I remove this folder?

I have a folder that appeared suddenly and I want to get rid of it. I'm using Linux Mint btw. The location is ~/.local/share/Trash/files/AhCBFJnAYJ It is about 1GB in size and I have no memory of creating it. I can't list the folder's contents…
Diogenes
  • 35
  • 1
  • 8
-1
votes
1 answer

Exclude files while removing folders recursively

I'm working on public project - which replaces FTP deployment method fully with GIT for PHP based projects. You place 1 file - deploy php in you website's root directory. That's all. When you push something into Bitbucket git repo, this script…
heron
  • 3,611
  • 25
  • 80
  • 148
-2
votes
1 answer

mkdir immediatly after rmdir gives me access denied

I have a folder (let's call it F). I wrote a batch file that does rmdir F /S /Q mkdir F When I call the mkdir F, it gives me access denied, probably because the system may be still deleting F. How can I do to deal with this problem?
Daniel
  • 7,357
  • 7
  • 32
  • 84
-2
votes
2 answers

Unlink all but one filetype

How can I remove ALL but .sql file extensions in a specific folder with php? It's a php file that is supposed to create a backup of the database and place it in a back up folder but if there are any .jpg or any other extensions it should remove them…
Momo
  • 11
1 2 3
10
11