We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c787ab2 commit 225a908Copy full SHA for 225a908
1 file changed
src/bd2k/util/files.py
@@ -14,6 +14,20 @@ def mkdir_p( path ):
14
else:
15
raise
16
17
+
18
+def rm_f( path ):
19
+ """
20
+ Remove the file at the given path with os.remove(), ignoring errors caused by the file's absence.
21
22
+ try:
23
+ os.remove( path )
24
+ except OSError as e:
25
+ if e.errno == errno.ENOENT:
26
+ pass
27
+ else:
28
+ raise
29
30
31
if False:
32
33
# These are not needed for Python 2.7 as Python's builtin file object's read() and write()
0 commit comments