Questions tagged [delete-file]

Tag for questions regarding file deletion. O.S. independent.

2105 questions
0
votes
1 answer

Delete a file in use by another process in vb.net / framework 2.0

I have a program that watches if there is a file with a certain name, in a certain directory. the FileStream is created with the sequent command: fs = File.Open(PathK, FileMode.Append, FileAccess.Write, FileShare.None) After half an hour, the…
0
votes
2 answers

ClosedXML can't delete file after saving Workbook "process in use"

So here's the code: string filename = @"c:\test.xlsx"; using (XLWorkbook wb = CreateWorkbookInformation()) { wb.SaveAs(filename); …
0
votes
3 answers

deleting a file locally when deleting from a Firebase storage

I work on a app and I want to know if it is possible to delete a file downloaded from Firebase Storage or Google cloud, on all device using this app, when the file is deleted from from storage. Thanks
0
votes
1 answer

c# Write file to S3 and then delete the local file

The following program pulls data from a web service writes it to a csv, uploads the file to S3 and then deletes it. The problem I am having is that it cannot delete the file because it says "System.IO.IOException: 'The process cannot access the…
red79phoenix
  • 91
  • 3
  • 14
0
votes
1 answer

Temporary creating bitmaps in Android then deleting them

So I am working on a project where if a manager registers a user he gets an email with a QR code (bitmap). The QR code is saved in cache. I want the QR code removed after the QR code is sent to the user, but a "cache" folder gets created (also shows…
Chris Fodor
  • 119
  • 21
0
votes
0 answers

Unable to delete files inside the directory in java

I know this issue is very common but I don't know why its not deleting the file. here is my code below: String newRoot = rootFile.toString(); File[] transFiles = new File(newRoot).listFiles(); for(File file : transFiles){ …
user123040569
  • 39
  • 1
  • 1
  • 8
0
votes
1 answer

iterate arrays in python and delete those file if it exists

I have a Python script as shown below which reads four files and give the difference between those files for each clientId and it works fine: #!/usr/bin/python import os, sys, re, json with open(sys.argv[1]) as old_primary, open(sys.argv[2]) as…
user1950349
  • 4,738
  • 19
  • 67
  • 119
0
votes
4 answers

Android delete file from removable sd card (second external storage)

I've read all topics in this forum but nothing works for me. I have arraylist of paths of files and I need to delete some of them. In my code I try to use: File file = new File(filesPath.get(0)); file.delete(); if (file.exists()) { …
dmytro
  • 246
  • 8
  • 21
0
votes
0 answers

Unable to delete video file (/storage/6638-3139/DCIM/Camera/20180503_144303.mp4 )from external storage in android

I am trying to delete a video file located at the path /storage/6638-3139/DCIM/Camera/20180503_144303.mp4 I have done below code for that. delete(getContext(),file); public static boolean delete(final Context context, final File file) { final…
0
votes
2 answers

Android: delete image on sd card

Android 7.0, API 24. Permissions are granted in both AndroidManifest and real time. Following are the scenarios which I have tried: Only using the content resolver removes it from MediaStore but it comes back when the device is restarted. When…
0
votes
0 answers

php unable to delete Images

I have below code to delete posts from my website. This function is working for video posts and it delete video post perfectly. But it is not working for image posts and does not delete post image from web directory. My code is function…
Mark
  • 67
  • 7
0
votes
1 answer

Is there a way to hard delete (shift delete) a directory and it's files using C#?

So I'm writing code to download some files from a sharepoint, store them locally in a tempFolder, then create a .zip file with these files and then I want to remove the tempFolder & it's files under it. Right now "File.Delete" does that, but all the…
Tempuslight
  • 1,004
  • 2
  • 17
  • 34
0
votes
0 answers

looking for script to delete files in folder. IF ALL FILES ARE OVER A YEAR OLD - but ALL Have to be that old

Looking to delete the folder - IF all files inside that folder are over a year old. If even 1 file isn't, I need to leave the ENTIRE folder untouched. Very specific, I know. I should add I have a good amount of folders to complete this on.
0
votes
1 answer

Why can't I delete this file from my Xcode project?

Being new to Xcode, I foolishly added "wrong_answer.mp3" via "add files to.." to my project and in the wrong place, but I cannot remove this reference from my project. I deleted the underlying file from the file system, but I cannot find in Xcode…
angryITguy
  • 9,332
  • 8
  • 54
  • 82
0
votes
1 answer

How to write a batch file to delete multiple specific files from different paths?

Each time before I start debugging, I need to delete some specific files from different paths. It's a tiresome process as I do it like a million times in a day. So I want to write a batch file that deletes all those at once without prompting. The…
iremenerys
  • 17
  • 6