delete-directory Questions

25

The below code only deletes the first file it gets inside the web dir. I want to remove all the files and folders inside the web directory and retain the web directory. How can I do that? - name: r...
Chandlery asked 5/7, 2016 at 10:12

22

Solved

What is the simplest way to forcefully delete a directory and all its subdirectories in PowerShell? I am using PowerShell V2 in Windows 7. I have learned from several sources that the most obvious...
Nationality asked 17/11, 2009 at 23:43

25

Solved

I want the users of my application to be able to delete the DCIM folder (which is located on the SD card and contains subfolders). Is this possible, if so how?
Johnnie asked 9/2, 2011 at 10:32

7

Solved

How can I delete all files and subdirectories from current directory including current directory?
Diagram asked 15/2, 2009 at 14:8

18

How can I delete a folder using C++? If no cross-platform way exists, then how to do it for the most-popular OSes - Windows, Linux, Mac, iOS, Android? Would a POSIX solution work for all of them? ...
Icily asked 9/4, 2009 at 15:26

30

Solved

I want to create and delete a directory using Java, but it isn't working. File index = new File("/home/Work/Indexer1"); if (!index.exists()) { index.mkdir(); } else { index.delete(); if (!index...
Mince asked 29/11, 2013 at 9:4

26

Solved

Is there a way to delete entire directories recursively in Java? In the normal case it is possible to delete an empty directory. However when it comes to deleting entire directories with contents,...
Walz asked 22/4, 2009 at 22:25

11

Solved

I need to delete a directory that contains read-only files. Which approach is better: Using DirectoryInfo.Delete(), or, ManagementObject.InvokeMethod("Delete")? With DirectoryInfo.Delete(), I ...
Ansley asked 4/3, 2009 at 18:47

5

How can I delete a folder with all it's files/subdirectories (recursive deletion) in C++?
Psychotechnics asked 19/7, 2009 at 12:8

21

Solved

How do I delete a directory and its entire contents (files and subdirectories) in PHP?
Pettway asked 26/7, 2010 at 19:9

21

Solved

I deleted manually a directory I just added, offline, in my repository. I can't restore the directory. Any attempt to do an update or a commit will fail with: "blabla/.svn" containing working co...
Endothelioma asked 8/9, 2009 at 13:36

4

Solved

I am trying to delete a file located at the path /storage/714D-160A/Xender/image/Screenshot_commando.png What I've done so far: try{ String d_path = "/storage/714D-160A/Xender/image/Screensho...
Imponderabilia asked 22/7, 2017 at 10:59

7

Solved

If you delete a directory from an SVN working copy, but haven't committed yet, it's not obvious how to get it back. Google even suggests "svn undo delete before commit" as a common query when you t...
Teirtza asked 23/11, 2009 at 23:5

10

Solved

I know this will delete everything in a subdirectory and below it: rm -rf <subdir-name> But how do you delete everything in the current directory as well as every subdirectory below it and...
Ahriman asked 4/5, 2009 at 16:16

7

Solved

I have a share that is a "junk drawer" for end-users. They are able to create folders and subfolders as they see fit. I need to implement a script to delete files created more than 31 days old. I...
Alanealanine asked 15/10, 2009 at 22:29

7

Solved

The rmdir() function fails if the folder contains any files. I can loop through all of the the files in the directory with something like this: foreach (scandir($dir) as $item) { if ($item == '.'...
Thousand asked 18/8, 2009 at 21:38

3

I would like to delete all folders except MYFOLDER found in a parent directory but I cant get it done? for %%i in ("C:\Parent") do if not "%%i"=="MYFOLDER" del /f /q "%%i could somebody please c...
Leena asked 10/1, 2014 at 15:48

1

Solved

Is it possible to delete all the subfolders (with content) and files within a folder? For example: Backup November pic1.jpg pic2.jpg December January pic3.jpg example1.txt example2.txt exam...
Yearbook asked 3/12, 2014 at 13:14

6

I am trying to write maintainer scripts for debian package. Assume that I have a directory structure as follows: application/ ----application/file1.txt ----application/file2.txt ----application/co...
Lysenko asked 8/8, 2014 at 7:10

5

Solved

Issue: I have a Windows 7 sub-directory which I can't delete. While I know others here, and many more elsewhere on the Internet have asked about this general class of Windows 7 fil...
Arrangement asked 12/1, 2014 at 8:32

8

After enumerating a directory, I now need to delete all the files. I used: final File[] files = outputFolder.listFiles(); files.delete(); But this hasn't deleted the directory.
Tull asked 14/10, 2011 at 13:8

4

Solved

I want to look for the oldest directory (inside a directory), and delete it. I am using the following: rm -R $(ls -1t | tail -1) ls -1t | tail -1 does indeed gives me the oldest directory, the t...
Roadblock asked 31/8, 2010 at 18:59
1

© 2022 - 2024 — McMap. All rights reserved.