]>
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 - 2018, 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
20 path
= LongFilePathOsPath
22 def access(path
, mode
):
23 return os
.access(LongFilePath(path
), mode
)
29 return os
.remove(LongFilePath(path
))
32 Timeout
= Timeout
+ 0.1
33 return os
.remove(LongFilePath(path
))
36 return os
.removedirs(LongFilePath(name
))
39 return os
.rmdir(LongFilePath(path
))
42 return os
.mkdir(LongFilePath(path
))
44 def makedirs(name
, mode
=0777):
45 return os
.makedirs(LongFilePath(name
), mode
)
48 return os
.rename(LongFilePath(old
), LongFilePath(new
))
51 return os
.chdir(LongFilePath(path
))
53 def chmod(path
, mode
):
54 return os
.chmod(LongFilePath(path
), mode
)
57 return os
.stat(LongFilePath(path
))
59 def utime(path
, times
):
60 return os
.utime(LongFilePath(path
), times
)
64 uList
= os
.listdir(u
"%s" % LongFilePath(path
))
66 List
.append(UniToStr(Item
))
80 SEEK_SET
= os
.SEEK_SET
81 SEEK_END
= os
.SEEK_END