Skip to content

Commit

Permalink
Merge pull request sahlberg#27 from tokibito/master
Browse files Browse the repository at this point in the history
Added NFS.rename method
  • Loading branch information
sahlberg authored Aug 17, 2017
2 parents ed9867c + f21e014 commit 2078e9b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libnfs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,13 @@ def isdir(self, s):
return False
return stat.S_ISDIR(st.nfs_mode)

def rename(self, src, dst):
"""Rename file"""
ret = nfs_rename(src, dst)
if ret == -errno.ENOENT:
raise IOError(errno.ENOENT, 'No such file or directory')
return ret


@property
def error(self):
Expand Down

0 comments on commit 2078e9b

Please sign in to comment.