rename.py 394 B

1234567891011121314151617
  1. # Copyright (c) MetaCommunications, Inc. 2003-2007
  2. #
  3. # Distributed under the Boost Software License, Version 1.0.
  4. # (See accompanying file LICENSE_1_0.txt or copy at
  5. # http://www.boost.org/LICENSE_1_0.txt)
  6. import os.path
  7. import os
  8. def rename( log, src, dst ):
  9. log( 'Renaming %s to %s' % ( src, dst ) )
  10. if os.path.exists( dst ):
  11. os.unlink( dst )
  12. os.rename( src, dst )
粤ICP备19079148号