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

unlink multiple files in a C linux program

I am trying to simulate the behavior of linux commandline command rm a1*.txt using either wildcards or regular expressions, inside a C program (linux gcc). Is there a standard way of doing that?
mousomer
  • 2,632
  • 2
  • 24
  • 25
-1
votes
1 answer

PHP - file_exists takes very long

I want to prevent a PHP script from running at the same time. Which I achieved by checking if a 'lock.txt' file exists. This however takes multiple seconds, even though it should be very fast.
displaynn
  • 23
  • 6
-1
votes
1 answer

php delete file with unlink()

I have read a lot of pages about this but I just can't get it to work. I have a file on my server that needs to be deleted after the file has been imported. The file is a .csv file and opened with fopen. After import the file is closed with…
Interactive
  • 1,474
  • 5
  • 25
  • 57
-1
votes
1 answer

PHP unlink permision denied for last file

I have following problem. I have php script. It runs on virtual server Apache on windows PC. Php script find out number of files in directory. It loads data from each file by php functions file_get_contents and file. It processed data and than…
DaveH
  • 11
  • 1
-1
votes
1 answer

how to unlink between app and facebook in facebook-sdk?

first, I'am sorry. i can't english well. i have a problem in facebook sdk. now i am developing login with facebook sdk. and logout too. but i can't find unlink api between my-app and facebook. for example, some user using my app do not want to use…
Zeroshx
  • 1
  • 2
-1
votes
1 answer

Unlink multiple files from database

I have database that stores the name of the file in a column "name" and the extension in "ext" column I need to know how to get the data and merge the filename(.)ext into array and then using, $files = array('some-file.php',…
ahmedalimody
  • 48
  • 1
  • 6
-1
votes
1 answer

Delete files regardless extension

I have this code: @unlink($sMediaDir . $iLastID . '' . '.jpg'); How to delete files regardless their extensions? And make it work also with .png, .bmp etc? PHP: Delete a file with any extension? is not exactly what I am looking for. Thanks!
Tompo
  • 15
  • 6
-1
votes
4 answers

Delete a file from the server using unlink

I have a ffmpeg converter that converts videos into mp4's. After the conversion I want to delete the original video to save on file space. I tried using unlink($file_path) but it says permission denied. So far the video converts and generates a…
Paul Ledger
  • 1,125
  • 4
  • 21
  • 46
-1
votes
2 answers

codeigniter. delete_files not working when trying to delete image from directory

I am trying to delete an image using a button. when i click the button i use onClick"'.delete_files(assets/uploads/.$image->filename).'" But nothing is happening. The image is still where it was before I clicked the button. When I do a…
Kees Sonnema
  • 5,759
  • 6
  • 51
  • 106
-1
votes
1 answer

Is it ok to use unlink() to delete a folder?

Is there any downside to using unlink() to delete a folder (and its contents) in php?
Benjamin Allison
  • 2,134
  • 3
  • 30
  • 55
-1
votes
2 answers

Deleting file using unlink

I wanted to read the file that is given in command line arguments and delete it after reading . This is what I'm doing. char *filename = argv[1]; char *outputfile = strcat(argv[1], ".cmp"); fd = open(argv[1], O_RDONLY); chars = read(fd, buf,…
19285496
  • 71
  • 1
  • 3
  • 7
-2
votes
2 answers

unlink doesn't work

I am trying to use unlink command on my server Apache/2.2.3 PHP Version 5.2.10. I have been using the same script on a bunch of other servers including my local PC. Unfortunately, the command doesn't work. I tried this so far: chmod everything to…
Vadim.G
  • 15
  • 5
-2
votes
2 answers

unlink(202104241126Dell_Logo.png): No such file or directory

this function delete Brand but photo still save in folder inside public/upload/brands/ i want when make delete it remove photo from folder also. public function deleteBrand($request){ $deletelogo =…
Я Диша
  • 1
  • 1
  • 5
-2
votes
4 answers

Does the unlink function in C deallocate memory as well?

So I'm going through a piece of code in one of the programs and it uses an unlink function , where hist_name = malloc(128) However, I did notice that the program did not use a "free" to free the memory , but it did have the unlink function shown…
Mandi
  • 41
  • 5
-2
votes
1 answer

Change backslash to slash in PHP

I have a database that opens images that I have in a folder. I can delete the entry from the database but not the image. The path of the image in the database contains backslash, but the path of the folder to be deleted has slash. I need to change…