unlink

linux系统下文件的删除机制

让人想犯罪 __ 提交于 2019-12-06 01:34:54
很多人曾经说过,linux下的病毒没有windows多的原因在于linux使用的人不多,人们不屑于开发linux下的病毒,看到这个言论我笑了,想必很多人都有过explorer被注入的经历吧,explorer被替换然后怎么也删除不掉,或者一个system32下的一个顽固文件怎么也删除不掉,更不幸的是,它就是一个木马,此时,网上流行的一些工具就显得有用了,比如icesword,这些工具不得不动用内核驱动来靠内核的超高特权来删除那些文件,windows的注册表也是一个难缠的东西,一旦注册表被篡改,后果将不堪设想,因此注册表备份工具就显得必要,这一切的关键在于windows内核的架构,windows的启动过程非常的复杂,不仅是内核的启动,更有很多的用户空间的服务是用户所不能控制的,比如winlogon进程,在用户可以接手系统之前,很多的用户空间服务已经启动了,即便是安全模式也是这样,既然用户空间的东西可以在用户接手系统之前启动,那么如果这些是恶意程序的话,你的系统将乖乖的随黑客的心而动,恐怖吧,十分恐怖!windows的文件映射是一个十分令人又爱又恨的机制,它可以使你的重要文件在被访问期间不能被删除,当然也可以使病毒被使用期间不能被删除...这一切都是因为windows将文件的删除和文件保护以及系统安全统一在了一起,这是它微内核的架构所决定的

How to unlink (delete) an image in CodeIgniter

大城市里の小女人 提交于 2019-12-05 01:18:19
I try to unlink an image in CodeIgniter, but the unlink function shows: notice Undefined index: userfile Here is my code <?php function get_from_post(){ $data['logo_name'] = $this->input->post('logo_name',TRUE); $data['logo_thumb'] = $_FILES['userfile']['name']; return $data; } function deleteconf($data){ $data= $this->get_from_post(); $update_id=$this->uri->segment(3); @unlink(base_url.'image/logo_thumb'.$logo_thumb); $query= $this->_delete($update_id); } ?> the unlink function shows notice Undefined index: userfile The upload form, using multipart/form-data Make sure you've use enctype=

Difference between unlink and rm on unix

烂漫一生 提交于 2019-12-04 15:14:48
Whats the real different between these two commands? Why is the system call to delete a file called unlink instead of delete ? Eliyahu Skoczylas You need to understand a bit about the original Unix file system to understand this very important question. Unlike other operating systems of its era (late 60s, early 70s) Unix did not store the file name together with the actual directory information (of where the file was stored on the disks.) Instead, Unix created a separate " Inode table " to contain the directory information, and identify the actual file, and then allowed separate text files to

Deleting file in Node.js

牧云@^-^@ 提交于 2019-12-04 10:41:56
问题 I am using node in a Windows environment. When I use fs.unlinkSync(fileName), it seems to work. After the unlinkSync statement is executed, if I do a fs.existsSync(filename) it returns false indicating the file does not exists, but when I go to the physical drive I can still see the file. At this point in time if I try and delete the file manually, it throws Access denied. However, the file is automatically removed from the file system only when I stop the executing node script file. Is this

unlink/file_exists and file not found

自作多情 提交于 2019-12-04 06:23:18
I have this code in my application, often run in race condition by severals users of my application clearstatcache(TRUE, $filepath); if(file_exists($filepath)) unlink($filepath); But, for this line of code, I still have severals errors each day like unlink(file): No such file or directory Server run Apache 2.2 and PHP 5.3.3. I know race problem, but think @ operator is just evil. I have first tried without any parameter for clearstatcache(), with the same error. How can I do it the correct way? you can try this if(@unlink($path)) { echo "Deleted file "; } else{ echo "File can't be deleted"; }

How to use Unlink() function

纵饮孤独 提交于 2019-12-04 01:22:18
I'm trying to use PHP unlink() function to delete away the specific document in the folder. That particular folder has already been assigned to full rights to the IIS user. Code: $Path = './doc/stuffs/sample.docx'; if (unlink($Path)) { echo "success"; } else { echo "fail"; } It keep return fail. The sample.docx does reside on that particular path. Kindly advise. I found this information in the comments of the function unlink() Under Windows System and Apache, denied access to file is an usual error to unlink file. To delete file you must to change the file's owner. An example: chown(

PHP unlink() handling the exception

拟墨画扇 提交于 2019-12-03 23:46:20
Well, I have been wondering if I can handle the unlink() function properly. I dont want the unlink() function to throw some nasty error if it is unable to unlink the file (may be due to the File not found). I tried something like try { unlink("secret/secret.txt"); } catch(Exception $e) { print "whoops!"; //or even leaving it empty so nothing is displayed } But it is not working. I am no expert in PHP. I searched and found this exception handling code somewhere in the web. But as I can remember my school days, the same was used for Java. SO it should have worked. I dont know whats wrong with

使用 supervisor 管理进程遇到的问题

ぐ巨炮叔叔 提交于 2019-12-03 18:12:03
# supervisorctl status unix:///var/tmp/supervisor.sock refused connection # supervisord -c /etc/supervisord.conf Error: could not find config file /etc/supervisor/supervisord.conf For help, use /usr/bin/supervisord -h # whereis supervisord.conf supervisord: /usr/bin/supervisord /etc/supervisord.conf /etc/supervisord # supervisord -c /etc/supervisord.conf Unlinking stale socket /var/tmp/supervisor.sock # unlink /tmp/supervisor.sock unlink: cannot unlink `/tmp/supervisor.sock’: No such file or directory # unlink /var/tmp/supervisor.sock # supervisorctl status unix:///var/tmp/supervisor.sock no

Deleting file in Node.js

大城市里の小女人 提交于 2019-12-03 06:32:33
I am using node in a Windows environment. When I use fs.unlinkSync(fileName), it seems to work. After the unlinkSync statement is executed, if I do a fs.existsSync(filename) it returns false indicating the file does not exists, but when I go to the physical drive I can still see the file. At this point in time if I try and delete the file manually, it throws Access denied. However, the file is automatically removed from the file system only when I stop the executing node script file. Is this the expected behavior? If the file has been opened and not closed within your NodeJS code, you'll