]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Source/Python/Common/LongFilePathOs.py
BaseTools/Common: add MM Module data types.
[mirror_edk2.git] / BaseTools / Source / Python / Common / LongFilePathOs.py
CommitLineData
1be2ed90
HC
1## @file\r
2# Override built in module os to provide support for long file path\r
3#\r
4# Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
5# This program and the accompanying materials\r
6# are licensed and made available under the terms and conditions of the BSD License\r
7# which accompanies this distribution. The full text of the license may be found at\r
8# http://opensource.org/licenses/bsd-license.php\r
9#\r
10# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
12#\r
13\r
14import os\r
15import LongFilePathOsPath\r
16from Common.LongFilePathSupport import LongFilePath\r
17from Common.LongFilePathSupport import UniToStr\r
18\r
19path = LongFilePathOsPath\r
20\r
21def access(path, mode):\r
22 return os.access(LongFilePath(path), mode)\r
23\r
24def remove(path):\r
25 return os.remove(LongFilePath(path))\r
26\r
27def removedirs(name):\r
28 return os.removedirs(LongFilePath(name))\r
29\r
30def rmdir(path):\r
31 return os.rmdir(LongFilePath(path))\r
32\r
33def mkdir(path):\r
34 return os.mkdir(LongFilePath(path))\r
35\r
36def makedirs(name, mode=0777):\r
37 return os.makedirs(LongFilePath(name), mode)\r
38\r
39def rename(old, new):\r
40 return os.rename(LongFilePath(old), LongFilePath(new))\r
41\r
42def chdir(path):\r
43 return os.chdir(LongFilePath(path))\r
44\r
45def chmod(path, mode):\r
46 return os.chmod(LongFilePath(path), mode)\r
47\r
48def stat(path):\r
49 return os.stat(LongFilePath(path))\r
50\r
0923aa1c
HC
51def utime(path, times):\r
52 return os.utime(LongFilePath(path), times)\r
1be2ed90
HC
53\r
54def listdir(path):\r
55 List = []\r
56 uList = os.listdir(u"%s" % LongFilePath(path))\r
57 for Item in uList:\r
58 List.append(UniToStr(Item))\r
59 return List\r
60\r
61environ = os.environ\r
62getcwd = os.getcwd\r
63chdir = os.chdir\r
64walk = os.walk\r
65W_OK = os.W_OK\r
66F_OK = os.F_OK\r
67sep = os.sep\r
68linesep = os.linesep\r
69getenv = os.getenv\r
70pathsep = os.pathsep\r
71name = os.name\r
72SEEK_SET = os.SEEK_SET\r
73SEEK_END = os.SEEK_END\r