Questions tagged [delete-file]

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

2105 questions
0
votes
2 answers

Why does following Directory.Delete throw IOException The directory is not empty

I am creating a directory and setting up a FileSystemWatcher on it. Then I create a file. All this is done in the form constructor. In a button event handler I delete the directory created above. Sometimes it throws a IOException: The directory is…
AEonAX
  • 501
  • 12
  • 24
0
votes
2 answers

Delete fileName.* from host

I need a code that deletes every file in a special folder with special name but every suffix. For example: sample.txt sample.jpg sample.pdf sample.png I work with Zend Framework. Has zend any tools for deleting files?
afsane
  • 1,889
  • 6
  • 25
  • 40
0
votes
1 answer

How to Find a Folder's contents and delete them in another Folder?

I'm trying to create a program that can have a whitelist folder and a target folder. The whitelist folder tells the program what to delete in the target folder. For example lets say I have FOLDER1 and FOLDER2 FOLDER1 has a Text document named…
0
votes
1 answer

How to delete files recursively & skip deletion, when subfolder contains .one files?

My goal is to delete a file named Open Notebook.onetoc2 in all folders and subfolders of Z: drive, BUT NOT delete that file from those folders, which contain *.one files (actual OneNote files). I have searched for solutions online for that matter,…
Artto
  • 1
  • 1
0
votes
1 answer

ImageField won't delete file when using os.unlink()

I have this model: class UserProfile(models.Model): """(UserProfile description)""" user = models.ForeignKey(User) image = models.ImageField(upload_to=upload_to) def save(self): os.unlink(self.image.path) …
dotty
  • 40,405
  • 66
  • 150
  • 195
0
votes
1 answer

Delete a file in download directory

I have been helped to create an app few months ago and i'm trying to make it evolved by myself and it's not as easy as I would like. I would like to delete a file that has been created in the download directory. I'm using this folder as a cache…
Ahriman
  • 115
  • 8
0
votes
0 answers

delete files based on filenames from array

Trying to write a bash script that deletes files based on names from an array that's read from a separete file. I include the file for the array in the script; delete_files.inc and it seems to populate the arrays just fine, but when I try to delete…
b0red
  • 47
  • 7
0
votes
1 answer

deletion of objects in bucket using object tags

I have to basically upload some objects in s3 bucket. Once done I had to do their object tagging which I did using put_object_tagging (). Now I am trying to filter the objects based on these tags so that I can delete the objects based on tags. I am…
0
votes
2 answers

how to delete files in a folder that are in column B and red

I need assistance. I need to delete old files in a folder. I have a list of the files in column B and the old files are colored RGB(255,0,0). Assuming that the code would read something like: Dim MyFolder As String Dim MyFile As String Dim cell…
Byron
  • 61
  • 1
  • 11
0
votes
1 answer

Java - How to delete files from a folder in Java?

I'm trying to delete files using a for-loop. for(int i = 0; i < 3; i++) { String pathName = "test" + i + ".csv"; boolean success = (new File(pathName)).delete(); } But this code deletes only the first file, but not the other ones.
jumpy
  • 73
  • 7
0
votes
3 answers

Cannot delete .nfs file inside EFS storage

On the docker image debian:stretch-slim, couldn't delete a specific folder on a NFS drive, using rm -rf /folder-name as root (or rm-rf * after entering the folder-name). Got the following error back: rm: cannot remove…
StackMaster
  • 359
  • 1
  • 5
  • 22
0
votes
0 answers

Removing a Line from a File without making a new file

I'm trying to remove a single line from a file without creating a new file. For example in the file before it is modified it would be: This is a file and after it would be: This a file However, with the way I'm currently trying to do it what…
7g3p
  • 23
  • 7
0
votes
1 answer

How do I delete a specific type of file (CSV files) within a specific folder with google app script on a shared google drive folder

I am having trouble adding files to the shared google drive folder as well as not being able to remove specific types of files of any kind within my script. The shared google drive file gives me issues. The code below works for me on my own personal…
bronesto
  • 11
  • 2
0
votes
2 answers

I want to delete file from server by bash script using ftp

I want to delete file by bash script using ftp I use below code $file = xyz/ab/file.txt curl -v -u $user:$pass ftp://server.com/$file -Q "DELE $file" but it's give these error *Entry path is '/' DELE xyz/ab/file.txt * ftp_perform ends with…
Partha
  • 81
  • 10
0
votes
1 answer

Remove Folder From Eclipse Workspace

I am trying to remove a folder (and the single file that it contains) from my eclipse workspace but there does not seem to be an option to simply remove the file. The only option is to delete it. When I tried to delete it, I got the following…
rahs
  • 1,759
  • 2
  • 15
  • 31