在文件的绝对路径的情况下,删除功能失败 [英] remove function fails in case of absolute path of file

查看:89
本文介绍了在文件的绝对路径的情况下,删除功能失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图删除一个文本文件,所以我使用remove();如果我只提供文件名它可以工作,但如果我使用文件的绝对路径,删除函数将无法做什么做绝对路径.. ...

解决方案

DeleteFile 使用绝对路径。



如果您使用remove()来查看它,也许您应该发布您使用的代码。


remove 函数应该与绝对路径同样良好地工作。也许您的路径规范不正确。记住你必须在字符串中指定反斜杠作为双反斜杠!



如果有疑问告诉我们你正在使用的代码,那么我们可以看看它

I was trying to delete a text file so i use the remove();if i give only file name it works but if i use absolute path of the file the remove function fails what to do in case of absolute path.....

解决方案

DeleteFile works with absolute paths.

Maybe you should post the code you used if you used remove() to take a look at it.


The remove function should work equally well with an absolute path. Perhaps your path specification is not correct. Remeber that you have to specify backslashes as double-backslashes in a strings!

If in doubt show us the code you are using, so we can have a look at it.


这篇关于在文件的绝对路径的情况下,删除功能失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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