Questions tagged [unlink]

Refers to removing a file from a filesystem.

This tag is appropriate for questions about deleting a file from a filesystem whether by using a language-specific function such as Perl or PHP's unlink or by making a system call such as Unix's unlink.

Wikipedia has more information about unlink.

526 questions
3
votes
2 answers

Don't understand why a code snippet from APUE unlinks a file attached to the client unix domain socket

The book defines 3 customized functions: int serv_listen(const char *name); //Returns: file descriptor to listen on if OK, negative value on error int serv_accept(int listenfd, uid_t *uidptr); //Returns: new file descriptor if OK, negative value on…
Rick
  • 7,007
  • 2
  • 49
  • 79
3
votes
1 answer

PHP: Unlink resource temporarily unavailable

I'm trying to delete a file after it is uploaded via a form and processed: // FORM SUBMIT if ($_SERVER["REQUEST_METHOD"] == "POST") { $uploadfile = getcwd() . '/pub/media/dealers/' . basename($_FILES['proof']['name']); …
AJK
  • 391
  • 9
  • 27
3
votes
1 answer

unlink function not working for image in Internet Explorer

I have a problem in image unlink in Internet Explorer, but it works in Mozilla. I have used php code:
soumya
  • 35
  • 7
3
votes
1 answer

Delay unlink after Header

I'm trying to create a secure document retrieval system for logged in users. First I check if the user is logged in. If they are I progress to copy the file from the protected directory on the server to the web accessible space within the users…
James
  • 190
  • 2
  • 4
  • 13
3
votes
1 answer

What happens if I unlink an opened fifo pipe?

I am working on an implementation of named pipes client/server for school. I have asked my teacher what happens if i use unlink while either of the pipes end is still opened. He had no answer for me. Anyone know?
Pain
  • 77
  • 1
  • 10
3
votes
1 answer

Can't delete file - open i Rstudio

Is there a way to force R to delete a file using unlink() when its open in R? When trying to R throws the warning: Warning message: In file.remove(ls) : cannot remove file 'dat.csv', reason 'Permission denied'. I have a large Global…
Jeppe Olsen
  • 968
  • 8
  • 19
3
votes
4 answers

Delete files with special characters in filenames

I need to delete old files with special characters in filenames like space,,,(,),! and so on via PHP. Classic unlink($filename) does not work for these files. How can I transform filenames to filenames which accepts unlink function and filesystem?…
gadelat
  • 1,390
  • 1
  • 17
  • 25
3
votes
1 answer

PHP - Delete local file after moving to AWS S3 - Text File Busy Error

I am using the AWS PHP SDK to move files from our server to S3, after they have been moved I want to delete them to save space on our server. But when I attempt to do this I get an PHP warning: Text file busy in /path/to/file. If I understand it…
MP_Webby
  • 916
  • 1
  • 11
  • 35
3
votes
4 answers

PHP unlink not working in codeigniter

codeigniter folder structure application system user_guide uploads Code: unlink('http://sale.coupsoft.com/uploads/'.$checkbox[$i]['Image']); I want to remove file from uploads folder but I am an unable to delete file by using HTTP.How can I remove…
Shah Rushabh
  • 147
  • 4
  • 16
3
votes
0 answers

Waiting for unlink() to finish task before next command in R

I want to delete a file, and once that file is deleted continue with my R script. For example: Create a folder with a .csv in it dir <- getwd() dir.create(file.path(dir, "folder"), showWarnings = FALSE) df <-…
ColinTea
  • 998
  • 1
  • 9
  • 15
3
votes
1 answer

PHP unlink large number of files

I have around 600k images in one directory, and i need to delete almost half of them with PHP. In one array i have stored names of files that need to be deleted and when I try to loop through array and call unlink($filename) server crashes after ~1k…
Milos R
  • 71
  • 1
  • 5
3
votes
1 answer

Does clang provide an unlink implementation?

I am trying to compile a library using clang. The library makes calls to 'unlink', which is not defined by clang: libmv/src/third_party/OpenExif/src/ExifImageFileWrite.cpp:162:17: error: use of undeclared identifier 'unlink'; did you mean 'inline'? …
MM.
  • 4,224
  • 5
  • 37
  • 74
3
votes
1 answer

How can I delete all files in a folder, which matches a certain pattern?

I have a folder with images. As example: z_1.jpg z_2.jpg z_3.jpg //... I want to delete every image with prefix z_*.jpg. How can I do that? unlink('z_*.jpg'); ?
Arriba
  • 305
  • 2
  • 3
  • 14
3
votes
2 answers

How to remove image from web root when data edit and update by cakephp

I write a edit function to update news's info, delete previous image from web root and insert new image: code is below: if(unlink($data['News']['image_url']['tmp_name'], WWW_ROOT . 'media/' . $data['News']['image_url']['name'])) //delete…
user4101645
3
votes
1 answer

php delete file using unlink before database row update

I'm setting up a CRUD and realized that I will need to delete the image that's stored in a directory if the user wants to upload a new image. I have a webpage with a form that brings the information from the database row using the id, then posts the…
tdrsam
  • 527
  • 1
  • 8
  • 28