]>
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.
14 from __future__
import absolute_import
16 from . import LongFilePathOsPath
17 from Common
.LongFilePathSupport
import LongFilePath
18 from Common
.LongFilePathSupport
import UniToStr
21 path
= LongFilePathOsPath
23 def access(path
, mode
):
24 return os
.access(LongFilePath(path
), mode
)
30 return os
.remove(LongFilePath(path
))
33 Timeout
= Timeout
+ 0.1
34 return os
.remove(LongFilePath(path
))
37 return os
.removedirs(LongFilePath(name
))
40 return os
.rmdir(LongFilePath(path
))
43 return os
.mkdir(LongFilePath(path
))
45 def makedirs(name
, mode
=0o777):
46 return os
.makedirs(LongFilePath(name
), mode
)
49 return os
.rename(LongFilePath(old
), LongFilePath(new
))
52 return os
.chdir(LongFilePath(path
))
54 def chmod(path
, mode
):
55 return os
.chmod(LongFilePath(path
), mode
)
58 return os
.stat(LongFilePath(path
))
60 def utime(path
, times
):
61 return os
.utime(LongFilePath(path
), times
)
65 uList
= os
.listdir(u
"%s" % LongFilePath(path
))
67 List
.append(UniToStr(Item
))
81 SEEK_SET
= os
.SEEK_SET
82 SEEK_END
= os
.SEEK_END