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
1 answer

php unlink() non-ascii characters = file not found

To be brief; php unlink is working with files if their name is asci. However unlink produce file not found error if i try to delete a file with a name including ç ö etc. Is there any way that i can fix this? Or is it a problem caused by the relation…
user2102266
  • 539
  • 3
  • 14
3
votes
2 answers

PHP unlink error - path error

I am using same syntax as everyone else but... i can't get it to work. I have tried quite a few options to unlink file from directory. Summary: delete.php (the file that executes the action) is in the main folder. The file (image) to be deleted is…
user2060451
  • 2,576
  • 3
  • 24
  • 31
3
votes
1 answer

Cannot unlink a file in PHP/Windows

I'm seeing a few questions raised on this topic, but looking around I have not managed to find a solution, unfortunately. I'm running PHP5.3 with Apache2 on Windows Server 2008. A PDF file is created by the script, and after being emailed needs to…
Katya S
  • 1,321
  • 3
  • 17
  • 31
3
votes
1 answer

What happens if you delete a file in PHP while the web server is serving the file to the website visitor

unlink("cache/data.xml"); I feel that this may generate an error at times when sever might be reading and serving it to the visitor. how to safely delete the file so script will continue to wait until the read lock from the web server is released…
user689751
2
votes
6 answers

Delete a directory not empty

rmdir("./uploads/temp/".$user."/"); I have many files in a directory I wish to remove in my PHP script, however these is no way for me to unlink() the file first. Is there a way I co do unlink(* FROM (dir=)) // don't downvote the long shot //…
TheBlackBenzKid
  • 26,324
  • 41
  • 139
  • 209
2
votes
1 answer

Does vfsStream allow unlink empty dir?

My unit test tries to remove an empty dir. The class under test uses unlink (result of a previous test). If I write the same code without vfsStream I cannot remove the empty dir. Unit test: require 'vfsStream/vfsStream.php'; require…
user972959
  • 381
  • 3
  • 5
2
votes
1 answer

PHP recursive delete function gives warning message

My function cleanup looks like that. function cleanUp($exdirs, $exfiles){ $it = new RecursiveIteratorIterator( new RecursiveDirectoryIterator('.'), RecursiveIteratorIterator::CHILD_FIRST ); foreach($it as $entry) { if ($entry->isDir() &&…
Mr. Magnet
  • 23
  • 3
2
votes
3 answers

Delete a file on the website using PHP?

Hey i'm trying to make my website delete a file using the unlink(); function. but when i try it comes up with this: Warning: unlink() [function.unlink]: cURL does not allow unlinking in /home/nzcraftn/public_html/filenz/user/delete.php on line…
Duncan Palmer
  • 2,865
  • 11
  • 63
  • 91
2
votes
4 answers

How to delete multiple PDF files in the current directory in javascript/node.js

I wanted to delete multiple files which are ending with .pdf under the current directory. Suppose I have 3 different pdf files, 1 image file, and one text file, so in these, I want to delete those 3 different pdf files only. What I have tried. 1st…
RAJENDRA H
  • 83
  • 10
2
votes
4 answers

Supervisor socket error: Unlinking stale socket /tmp/supervisor.sock

I installed Supervisor on a shared Debian server. When I run: supervisord -c supervisord.conf I get this error continuously untill I kill it:Unlinking stale socket /tmp/supervisor.sock When I run supervisorctl status I get:…
Heinz
  • 115
  • 2
  • 9
2
votes
2 answers

macOS 10.15 Terminal - unlink gets "Operation not permitted"

zsh; Terminal has Full Disk Access permission in System Preferences. /usr/bin % ls -alF python lrwxr-xr-x 1 root wheel 75 Jul 12 11:48 python@ -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 /usr/bin % sudo unlink…
brec
  • 259
  • 3
  • 10
2
votes
1 answer

Zip Multiple file Than unlink the file

open($archive_file_name, ZIPARCHIVE::CREATE) !== TRUE) { exit("cannot open <$archive_file_name>\n"); } //add each files of $file_name…
yukou
  • 305
  • 3
  • 6
  • 17
2
votes
0 answers

How do I delete an image from disk when I delete the data structure that contained it?

In my app the user has a page on his profile where he can upload images. In order to achieve that I made a Model of an image that, among others, has the name, url(on disk), and the mimitype of the image that is uploaded. Every time I upload an…
code_dude
  • 951
  • 2
  • 15
  • 28
2
votes
2 answers

Is there a way to completely remove an inode when the Link count is 2?

Currently my data is organised in a volume which has a cache directory (where all the files are first created or transferred). After that there are suitable directories on the volume which in their subdirs, contain files hardlinked to files in the…
Nishank
  • 23
  • 2
2
votes
1 answer

Laravel delete file in app folder (root)

How to delete files from Laravel app directory (not the public directory but the one in the root)? I tried : \Storage::Delete('App\file.php'); \Storage::Delete('\App\file.php'); \File::Delete('App\file.php'); \File::Delete('\App\file.php'); unlink…
Victordb
  • 519
  • 1
  • 11
  • 25