Python3 os 模块 Link 方法
Python3 os 模块 Link 方法 #!/usr/bin/python3 import os, sys # Open a file path = "d:\\python3\\foo.txt" fd = os.open( path, os.O_RDWR|os.O_CREAT ) # Close opened file os.close( fd ) # Now create another copy of the above file. dst = "d:\\tmp\\foo.txt" os.link( path, dst) print ("Created hard link successfully!!")
Python3 os 模块 Link 方法
#!/usr/bin/python3 import os, sys # Open a file path = "d:\\python3\\foo.txt" fd = os.open( path, os.O_RDWR|os.O_CREAT ) # Close opened file os.close( fd ) # Now create another copy of the above file. dst = "d:\\tmp\\foo.txt" os.link( path, dst) print ("Created hard link successfully!!")
交流与评论