如何在 Windows 7 中使用取消链接? [英] How to use unlink in Windows 7?

查看:42
本文介绍了如何在 Windows 7 中使用取消链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Win 7 机器中使用 unlink 时遇到问题.这是我在 getFile.php 中的代码

I have a problem when using unlink in my Win 7 machine. This is my code in getFile.php

$file_name = 'C:\xampp\htdocs\fw\tmp\my_file.php';
$myfile = fopen($file_name , 'a');
unlink(''.$file_name );

每次我执行代码时,我都会收到一条错误消息

everytime I execute the code, i get an error message

警告:unlink(C:\xampp\htdocs\fw\tmp\my_file.php) [function.unlink]: 权限在 C:\xampp\htdocs\fw\libraries\getFile.php 中被拒绝79

有人有解决方案吗?

之前谢谢,

推荐答案

您无法删除已打开的文件

You cann't remove files that are opened

$file_name = 'C:\xampp\htdocs\fw\tmp\my_file.php';
$myfile = fopen($file_name , 'a');
..
fclose($myfiles);
..
unlink(''.$file_name );

这篇关于如何在 Windows 7 中使用取消链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆