]>
git.proxmox.com Git - mirror_edk2.git/blob - BaseTools/Source/Python/Common/LongFilePathOs.py
2 # Override built in module os to provide support for long file path
4 # Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>
5 # This program and the accompanying materials
6 # are licensed and made available under the terms and conditions of the BSD License
7 # which accompanies this distribution. The full text of the license may be found at
8 # http://opensource.org/licenses/bsd-license.php
10 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 import LongFilePathOsPath
16 from Common
.LongFilePathSupport
import LongFilePath
17 from Common
.LongFilePathSupport
import UniToStr
19 path
= LongFilePathOsPath
21 def access(path
, mode
):
22 return os
.access(LongFilePath(path
), mode
)
25 return os
.remove(LongFilePath(path
))
28 return os
.removedirs(LongFilePath(name
))
31 return os
.rmdir(LongFilePath(path
))
34 return os
.mkdir(LongFilePath(path
))
36 def makedirs(name
, mode
=0777):
37 return os
.makedirs(LongFilePath(name
), mode
)
40 return os
.rename(LongFilePath(old
), LongFilePath(new
))
43 return os
.chdir(LongFilePath(path
))
45 def chmod(path
, mode
):
46 return os
.chmod(LongFilePath(path
), mode
)
49 return os
.stat(LongFilePath(path
))
51 def utime(path
, times
):
52 return os
.utime(LongFilePath(path
), times
)
56 uList
= os
.listdir(u
"%s" % LongFilePath(path
))
58 List
.append(UniToStr(Item
))
72 SEEK_SET
= os
.SEEK_SET
73 SEEK_END
= os
.SEEK_END