from CommonDataClass.DataClass import *\r
from Common.Parsing import GetSplitValueList\r
from Common.LongFilePathSupport import OpenLongFilePath as open\r
+from Common.LongFilePathSupport import CopyLongFilePath as CopyLong\r
+from Common.LongFilePathSupport import LongFilePath as LongFilePath\r
from Common.MultipleWorkspace import MultipleWorkspace as mws\r
from CommonDataClass.Exceptions import BadExpression\r
from Common.caching import cached_property\r
#\r
def SaveFileOnChange(File, Content, IsBinaryFile=True, FileLock=None):\r
\r
+ # Convert to long file path format\r
+ File = LongFilePath(File)\r
+\r
if os.path.exists(File):\r
if IsBinaryFile:\r
try:\r
# @retval False No copy really happen\r
#\r
def CopyFileOnChange(SrcFile, Dst, FileLock=None):\r
+\r
+ # Convert to long file path format\r
+ SrcFile = LongFilePath(SrcFile)\r
+ Dst = LongFilePath(Dst)\r
+\r
if not os.path.exists(SrcFile):\r
return False\r
\r
# copy the src to a temp file in the dst same folder firstly, then\r
# replace or rename the temp file to the destination file.\r
with tempfile.NamedTemporaryFile(dir=DirName, delete=False) as tf:\r
- shutil.copy(SrcFile, tf.name)\r
+ CopyLong(SrcFile, tf.name)\r
tempname = tf.name\r
try:\r
if hasattr(os, 'replace'):\r