delete-file

How guarantee the file will be deleted after automatically some time? [closed]

喜夏-厌秋 提交于 2019-12-03 17:34:23
Closed . This question is opinion-based. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it can be answered with facts and citations by editing this post . Closed 2 years ago . I have to store an image for a few minutes after user upload it until user confirm and i store in database So i'm wondering of creating a temporary file and use it to display preview. But I have to be sure that the file will be deleted after some time if user not interact anymore I found this article about temporary files and how delete them automatically https:/

PowerShell script to delete files from list and output list of deleted file

萝らか妹 提交于 2019-12-03 17:15:40
I have a list of files including their location in a .txt like the following: \SERVER01\backupsFolder\xx\a\ss.bak \SERVER01\backupsFolder\xx\a\ss.bak \SERVER02\backupsFolder\yy\b\dd.bak \SERVER02\backupsFolder\yy\b\dd.bak How do I delete everything else recursively starting from the 'backupsFolder' folder for example, and also output all the deleted files? kunal I think this should help. Script: $TargetFolder = “Pathofyourfolder” $Files = Get-ChildItem $TargetFolder -Exclude (gc List.txt) -Recurse foreach ($File in $Files) { write-host “Deleting File $File” -foregroundcolor “Red”; Remove-Item

What happen if I delete App.config in C# application?

自闭症网瘾萝莉.ら 提交于 2019-12-03 15:24:08
问题 I write a small application, that I don't need store anything in config files. So the file App.config in my source is exactly what ever Visual Studio has created. So I want to delete this file from source code (before compiling). But I noticed that it also contains the .NET version information. I wonder if I delete App.config file, then copy my application to other pc, is it have any strange behavior? 回答1: I wonder if I delete App.config file, then copy my application to other pc, is it have

DeleteFile fails on recently closed file

陌路散爱 提交于 2019-12-03 12:42:39
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 nothing suspicious. Snazzer Windows is notorious for this issue. SQLite handles the problem by retrying

How to locate and recover a deleted file

偶尔善良 提交于 2019-12-03 09:48:25
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? 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 simply do : hg revert -r <my revision> path/to/foo.txt hg commit -m "add the foo.txt file again" Using revsets:

Need a shell script that deletes all files except *.pdf

China☆狼群 提交于 2019-12-03 09:13:07
Can anyone write a shell script that deletes all the files in the folder except those with pdf extension? This will include all subdirectories: find . -type f ! -iname '*.pdf' -delete This will act only in the current directory: find . -maxdepth 1 -type f ! -iname '*.pdf' -delete $ ls -1 | grep -v '.pdf$' | xargs -I {} rm -i {} Or, if you are confident: $ ls -1 | grep -v '.pdf$' | xargs -I {} rm {} Or, the bulletproof version: $ find . -maxdepth 1 -type f ! -iname '*.pdf' -delete This should do the trick: shopt -s extglob rm !(*.pdf) ls | grep -v '.pdf$' | xargs rm This will filter all files

Securely deleting a file in C#.NET

丶灬走出姿态 提交于 2019-12-03 08:53:32
In a project I am doing I want to give users the option of 'securely' deleting a file - as in, overwriting it with random bits or 0's. Is there an easy-ish way of doing this in C#.NET? And how effective would it be? You could invoke sysinternals SDelete to do this for you. This uses the defragmentation API to handle all those tricky edge cases. Using the defragmentation API, SDelete can determine precisely which clusters on a disk are occupied by data belonging to compressed, sparse and encrypted files. If you want to repackage that logic in a more convenient form, the API is described here .

How do you completely delete projects in Xcode?

烈酒焚心 提交于 2019-12-03 05:43:07
So if I go into my selected save folder for my projects and delete my project it no longer shows up in Xcode. However I can still find some other files if I look under my user name/Library/Developer/Xcode/DerivedData. There are other files Xcode creates and I'm afraid if I make, and delete a bunch of projects, it is just gonna clutter my Mac with a mess of unneeded files. So how do I completely remove a project in Xcode? Appreciate the help. Xcode 9 In Finder, delete the project folder. (If you don't know where it is, open the project in Xcode and right click on project name in the Project

What happen if I delete App.config in C# application?

烂漫一生 提交于 2019-12-03 05:08:18
I write a small application, that I don't need store anything in config files. So the file App.config in my source is exactly what ever Visual Studio has created. So I want to delete this file from source code (before compiling). But I noticed that it also contains the .NET version information. I wonder if I delete App.config file, then copy my application to other pc, is it have any strange behavior? I wonder if I delete App.config file, then copy my application to other pc, is it have any strange behavior? Nope, it should be fine. There are various (somewhat tortuous) rules about exactly

Remove File from all Commits

橙三吉。 提交于 2019-12-03 03:41:52
问题 I have uploaded a font file that I don't have the rights to distribute to git hub several updates ago. I have a relatively inactive repository and I have the ability to notify all of my members if necessary. I've tried several of the solutions. I need to delete a file in my directory called Resources\Video\%font%.ttf where %font% is the name of the plain, italicized and bold versions of the font. What commands do I use? 回答1: In that case you could to use Git Filter Branch command with --tree