delete-file

Delete Image Files From Server

◇◆丶佛笑我妖孽 提交于 2019-11-28 02:58:35
问题 I wonder whether someone may be able to help me please. I've put together this page which allows users to view their uploaded images in a gallery format. I'm now wanting to add the delete functionality to each image. I've created the button and the Javascript behind it, but I'm really not sure how to link the 'button click' with the actual physical deletion of the file. The images aren't stored in a database but are in two folder locations on my server, in the following structure:

Can I delete data from iOS DeviceSupport?

余生颓废 提交于 2019-11-28 02:30:44
After going through and cleaning my disk with old things that I didn't need anymore, I came across the iOS DeviceSupport folder in ~/User/Library/Developer/Xcode which was taking nearly 20 GB. A similar question has been asked before , but since then many things have changed and I would like an up-to-date answer. As long as I have the version I use for testing, can I delete the older/unused versions without breaking anything? The ~/Library/Developer/Xcode/iOS DeviceSupport folder is basically only needed to symbolicate crash logs. You could completely purge the entire folder. Of course the

java file.delete() returns false but file.exists() returns true

十年热恋 提交于 2019-11-28 00:43:48
When I am trying to delete a file which is present in tomcat server conf/Catalina/localhost from java code then file.delete() always returns false. But if I am checking the file by file.exists() function it returns true. I am not getting any exception. Please help us why this is happening. What is the solution for this? When I am trying to delete a file which is present in tomcat server conf/Catalina/localhost from java code then file.delete() always returns false. But if i am checking the file by file.exists() function it returns true. Most likely you do not have permission for deleting file

Delete images from a folder

喜夏-厌秋 提交于 2019-11-27 18:10:21
问题 I want to to destroy all images within a folder with PHP how can I do this? 回答1: foreach(glob('/www/images/*.*') as $file) if(is_file($file)) @unlink($file); glob() returns a list of file matching a wildcard pattern. unlink() deletes the given file name (and returns if it was successful or not). The @ before PHP function names forces PHP to suppress function errors. The wildcard depends on what you want to delete. *.* is for all files, while *.jpg is for jpg files. Note that glob also returns

Delete files older than specific date in linux

心不动则不痛 提交于 2019-11-27 15:41:14
问题 I used the below command to delete files older than a year. find /path/* -mtime +365 -exec rm -rf {} \; But, now I want to delete all files whose modified time is older than 01 Jan 2014 How do I do it in linux. 回答1: You can touch your timestamp as a file and use that as a reference point: e.g. for 01-Jan-2014: touch -t 201401010000 /tmp/2014-Jan-01-0000 find /path -type f ! -newer /tmp/2014-Jan-01-0000 | xargs rm -rf this works because find has a -newer switch that we're using. From man find

How to delete files with a Python script from a FTP server which are older than 7 days?

佐手、 提交于 2019-11-27 15:09:23
I would like to write a Python script which allows me to delete files from a FTP Server after they have reached a certain age. I prepared the scipt below but it throws the error message: WindowsError: [Error 3] The system cannot find the path specified: '/test123/*.*' Do someone have an idea how to resolve this issue? Thank you in advance! import os, time from ftplib import FTP ftp = FTP('127.0.0.1') print "Automated FTP Maintainance" print 'Logging in.' ftp.login('admin', 'admin') # This is the directory that we want to go to path = 'test123' print 'Changing to:' + path ftp.cwd(path) files =

How do I .gitignore and delete an already committed file without affecting other working copies?

倖福魔咒の 提交于 2019-11-27 14:41:31
问题 I have a bare repository and two working copies - one on my machine, the other on the server. It turned out that I have to .gitignore a certain file that has to be specific for every machine. Let's call it ' settings.py '. This file is already committed. I did put ' settings.py ' in .gitignore to ignore it. When I now change the file on my machine git status still tells me modified: settings.py I figured out that I have to remove settings.py like this: git rm --cached settings.py Then git add

Batch file that keeps the 7 latest files in a folder

こ雲淡風輕ζ 提交于 2019-11-27 14:00:41
问题 Can anyone help me create a batch file? Basically, my goal is to create a batch file that will keep the LATEST 7 .txt files (in other words, the newest) in the folder and subsequently delete the rest. That's IF there are more than 7 files in the folder. The problem I'm having right now is the fact that the batch file that I have created deletes most of the files because their date is from a month or two or so. I want to keep the latest 7 files at all times no matter how old they are. So this

php script to delete files older than 24 hrs, deletes all files

旧时模样 提交于 2019-11-27 12:22:51
I wrote this php script to delete old files older than 24 hrs, but it deleted all the files including newer ones: <?php $path = 'ftmp/'; if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ((time()-filectime($path.$file)) < 86400) { if (preg_match('/\.pdf$/i', $file)) { unlink($path.$file); } } } } ?> (time()-filectime($path.$file)) < 86400 If the current time and file's changed time are within 86400 seconds of each other, then... if (preg_match('/\.pdf$/i', $file)) { unlink($path.$file); } I think that may be your problem. Change it to > or >= and it should work

Windows 2008 R2 - Kernel (System Process PID=4) is locking files and folders

天大地大妈咪最大 提交于 2019-11-27 11:42:13
Windows 2008 R2 - Kernel (System Process PID=4) is locking files and folders for a long time. For example when deleting a file, the file may remain locked for 1 minute or more and only after that be deleted. On another occasions I encountered files or folders I could not delete. ProcMon showed that the System Process was holding a handle to those resources for a couple of minutes and then released them None of the resources I mentioned were system resources, only files and folders installed be me and handled by my applications. Maiku Mori As Dani has already mentioned in the comment: It's a