删除将确保文件被删除? [英] delete will assure file is deleted?

查看:86
本文介绍了删除将确保文件被删除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


如果我使用os.remove(fileName),它是否始终确保代码将

仅移动到下一个代码fileName是否完全删除?


Pujo

Hello,

If I use os.remove(fileName), does it always assure that the code will
move to the next code only if the fileName is deleted completely?

Pujo

推荐答案

" aj *** *@gmail.com" < AJ **** @ gmail.com>写道:
"aj****@gmail.com" <aj****@gmail.com> writes:
你好,

如果我使用os.remove(fileName),它是否始终确保代码将移动到下一个代码只有在完全删除fileName的情况下?
Hello,

If I use os.remove(fileName), does it always assure that the code will
move to the next code only if the fileName is deleted completely?




嗯。文献说明并没有说。对FreeBSD进行快速测试显示

如果你没有权限删除该文件,则会产生一个例外,即b
。第二个测试显示,如果

文件不存在,则会得到相同的异常。


os中的东西往往与底层平台。你可能想在你的平台上测试



< mike

-

Mike Meyer< mw*@mired.org> http://www.mired.org/home/mwm/

独立的WWW / Perforce / FreeBSD / Unix顾问,电子邮件以获取更多信息。



Hmm. The documdentation doesn''t say. A quick test on FreeBSD shows
that if you don''t have permission to remove the file, an exception is
raised. A second test shows that you get a the same exception if the
file doesn''t exist.

Things in os tend to be tied tightly to the underlying platform. You
might want to test on your platform.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.


你好Mike,

我有要知道这个话题,否则我的程序必须检查

文件/文件是否已被删除,这有点乱。


Pujo
Hello Mike,
I have to know this topic otherwise my program has to check whether the
file / files are already deleted and this is a little bit messy.

Pujo


aj****@gmail.com 写道:
aj****@gmail.com wrote:
您好,

如果我使用os.remove(fileName),它是否始终确保代码将仅移动到下一个代码完全删除fileName?
Hello,

If I use os.remove(fileName), does it always assure that the code will
move to the next code only if the fileName is deleted completely?




是的,它将被删除,但不必完全删除。删除文件的内容并不等于
,因此有可能恢复已删除的文件,

plus在某些系统上保留已删除的文件进程(并且只有

为他们),他们仍在使用它们,并在每个人关闭时消失

他们。


- -

Maciej" Fiedzia" Dziardziel(fiedzia(at)fiedzia(dot)prv(dot)pl)
www。 fiedzia.prv.pl


Giraffiti:喷涂的混凝土艺术非常非常高。



Yes, it will be deleted, but not necessary completly. Deleting isn''t equal
to erasing file''s content, so it might be possible to recover deleted file,
plus on some systems deleted files are kept for those processes (and only
for them), who are still using them, and disappear when everyone close
them.

--
Maciej "Fiedzia" Dziardziel (fiedzia (at) fiedzia (dot) prv (dot) pl)
www.fiedzia.prv.pl

Giraffiti: Concrete art spray-painted very, very high.


这篇关于删除将确保文件被删除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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