delete-file

How to recursively delete multiple files with different extensions?

时光怂恿深爱的人放手 提交于 2019-12-05 14:47:09
I am trying to write a command to remove recursively several files with different extensions (*.extension1, *.extension2 etc) from the current directory and all its related sub-directories. So far I got this command from another post but I couldn't workout how to adapt it to more than one file in the same command line: find . -name "*.extension1" -type f -delete Is it as simple as below? find . -name "*.extension1";"*.extension2" -type f -delete Just as a side note , these are all output files that I do not need, but not all are necessarily always output so some of the extensions might not be

The most efficient way to delete millions of files based on modified date, in windows

本秂侑毒 提交于 2019-12-05 13:47:29
Goal: Use a script to run through 5 million - 10 million XML files and evaluate their date, if older than 90 days delete the file. The script would be run daily. Problem: Using powershell Get-ChildItem -recurse, causes the script to lock up and fail to delete any files, I assume this is because of the way Get-ChildItem needs to build the whole array before taking any action on any file. Solution ?: After lots of research I found that [System.IO.Directory]::EnumerateFiles will be able to take action on items in the array before the array is completely built so that should make things more

Performance of deleting folder with lots of files on iOS

给你一囗甜甜゛ 提交于 2019-12-05 11:47:08
Say I've got a folder in my iOS app's data directory with several thousand small files in it. Deleting this folder (via [NSFileManager removeItemAtPath] ) takes a nontrivial amount of time. But on OS X, deleting a folder with the same contents is very fast. It seems to simply unlink the folder from the filesystem. So why does iOS take so long? What is the difference? Edit: On an iPad 3, deleting 3 folders with 5,000 to 9,000 files each takes about 35 seconds. On the simulator running on an older Retina MBP, it takes about 1.5 seconds. Harsh The hierarchical structure that you see is not "real"

Firebase Storage Allow Deleting Files

谁都会走 提交于 2019-12-05 08:35:18
I have the following rules for user post image uploads, however current rules don't allow file deletion. How can I modify the rules to allow user to delete his pictures? What property on request variable indicates that a request is DELETE ? match /{uid}/posts/{pid}/{imageName} { allow read; allow write: if (uid == request.auth.uid) && (( ((imageName == "pic.jpg") || (imageName == "pic.png") || (imageName == "pic.gif")) && (request.resource.size < 5 * 1024 * 1024) && (request.resource.contentType.matches('image/.*')) )); } Is there something like this?: request.method == "DELETE" I can't find

Ignore deleted files in git?

梦想的初衷 提交于 2019-12-05 04:52:10
Is it possible to ignore deleted files in git? git update-index --assume-unchanged allows me to ignore modifications, but it still tracks deletions. (This is similar, but I couldn't find where "John Doe" restated his question: Ignore modified (but not committed) files in git? ) VonC Rather than trying to ignore the "delete" status, I would: not remove the directory and those files in it split the Git repo in two , effectively detaching the subdirectory to be removed into a separate Git repository. go on with the main Git repo. Note: that may not be compatible with a Git repo currently

How to delete files containing certain string using batch file in Windows?

≯℡__Kan透↙ 提交于 2019-12-05 03:13:14
My Panasonic camera uses its stupid PHOTOfunSTUDIO to import photos. It creates folders by the name of the date when photos are taken, and imports photos into those folders respectively. So far so good. But If I import again before removing all old pictures from camera, the old ones will be imported again by adding a name suffix (002),(003),..., no mater how I change the settings of that software. My question: how to remove all the files that having name suffixes from those folders? For example, this is one folder: D:\Photos\2011\2011-12-01>dir /b 20111201_184550(002).cont 20111201_184550(002)

What does it mean if some files in TortoiseSVN are marked “deleted” and others “deleted (+)” with a plus sign?

此生再无相见时 提交于 2019-12-04 22:21:08
I'm about to do a commit in TortoiseSVN involving rearranging a lot of files and directories. On the "commit" window, there are several files whose text status is "deleted" or "added" but others whose text status is "deleted (+)" or "added (+)". What does the (+) mean? (It's quite difficult to Google for a plus sign, and the word "plus" turns up lots of hits about the blue overlay icon meaning "added") The "+" means that TortoiseSVN was able to figure out the item's history, and has added the history metadata to this commit. For instance, say you rename a file from a to b . If you see the (+)

DeleteFile fails on recently closed file

喜欢而已 提交于 2019-12-04 20:10:31
问题 I have a single threaded program (C++, Win32, NTFS) which first creates a quite long temporary file, closes it, opens for read, reads, closes again and tries to delete using DeleteFile() . Usually it goes smoothly, but sometimes DeleteFile( ) fails, and GetLastError() returns ERROR_ACCESS_DENIED. File is not read-only for sure. It happens on files on any size, but the probability grows with the file size. Any ideas what may be locking the file? I tried WinInternals tools to check and found

Batch to delete all files in a folder with a wildcard in the path

≯℡__Kan透↙ 提交于 2019-12-04 19:30:10
So what I'm trying to do is go into every folder in the following directory "C:\Documents and Settings\" and for every folder in it, regardless of the name, check if this path exists "C:\Documents and Settings\*\Local Settings\Application Data\CSMRpt\" if it exists then delete all txt files inside that director, if the path doesn't exists then do nothing and move on to the next folder inside "C:\Documents and Settings\" This is what I came up with so far: set PATH = "\Local Settings\Application Data\CSMRpt\" set FILETYPE = "*.txt" for /d %%g in ("C:\Documents and Settings\*") do if exist %%g

How to locate and recover a deleted file

╄→尐↘猪︶ㄣ 提交于 2019-12-04 16:39:41
问题 At some stage in the past I had a "foo.txt" which was under Mercurial source control. However it has now been deleted. How can I recover the file when I don't know the last Mercurial revision in which the file was deleted? 回答1: If you know the exact path for the file, you can do something like : hg log -l 1 path/to/foo.txt This will show you the last changeset where foo.txt was modified, so you will be able to restore the file from this revision. Once you have the right revision, you can