Revision 04a8d789
b/lib/utils.py | ||
---|---|---|
960 | 960 |
def WriteFile(file_name, fn=None, data=None, |
961 | 961 |
mode=None, uid=-1, gid=-1, |
962 | 962 |
atime=None, mtime=None, close=True, |
963 |
check_abspath=True, dry_run=False, backup=False,
|
|
963 |
dry_run=False, backup=False, |
|
964 | 964 |
prewrite=None, postwrite=None): |
965 | 965 |
"""(Over)write a file atomically. |
966 | 966 |
|
... | ... | |
992 | 992 |
None if "close" parameter evaluates to True, otherwise file descriptor. |
993 | 993 |
|
994 | 994 |
""" |
995 |
if check_abspath and not os.path.isabs(file_name):
|
|
995 |
if not os.path.isabs(file_name): |
|
996 | 996 |
raise errors.ProgrammerError("Path passed to WriteFile is not" |
997 | 997 |
" absolute: '%s'" % file_name) |
998 | 998 |
|
Also available in: Unified diff