## @file\r
# Override built in module os to provide support for long file path\r
#\r
-# Copyright (c) 2014, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
import LongFilePathOsPath\r
from Common.LongFilePathSupport import LongFilePath\r
from Common.LongFilePathSupport import UniToStr\r
+import time\r
\r
path = LongFilePathOsPath\r
\r
return os.access(LongFilePath(path), mode)\r
\r
def remove(path):\r
- return os.remove(LongFilePath(path))\r
+ Timeout = 0.0\r
+ while Timeout < 5.0:\r
+ try:\r
+ return os.remove(LongFilePath(path))\r
+ except:\r
+ time.sleep(0.1)\r
+ Timeout = Timeout + 0.1\r
+ return os.remove(LongFilePath(path))\r
\r
def removedirs(name):\r
return os.removedirs(LongFilePath(name))\r