Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0030769Community[OCCT] OCCT:Foundation Classespublic2019-06-05 17:512019-06-06 05:41
ReporterVico Liang 
Assigned Toabv 
PlatformOSOS Version
Product Version[OCCT] 7.4.0* 
Target Version[OCCT] 7.4.0*Fixed in Version 
Summary0030769: OSD_FileNode::Exists () doesn't work properly on uwp
DescriptionThe function of below are latest git version, it will return false for file actually exist on uwp. It can be reproduced on windows 10 uwp simulator. The problem occurs in function GetFileAttributesExW which retuning false. Due to this issue, it's impossible to open and save ocaf document on uwp.

Standard_Boolean OSD_FileNode::Exists ()

 Standard_Boolean retVal = Standard_False;;
 TCollection_AsciiString fName;

 myPath.SystemName ( fName );

 if ( fName.IsEmpty () ) return Standard_False;
 TEST_RAISE( "Exists" );

 // make wide character string from UTF-8
 TCollection_ExtendedString fNameW(fName);


 if (!GetFileAttributesExW (fNameW.ToWideString(), GetFileExInfoStandard, &aFileInfo))
  if (GetLastError() != ERROR_FILE_NOT_FOUND)
    _osd_wnt_set_error (myError, OSD_WFileNode, fNameW.ToWideString());
  retVal = Standard_True;

 return retVal;

} // end OSD_FileNode :: Exists
TagsNo tags attached.
Test case number
Attached Files

- Relationships
related to 0030761verifiedbugmaster Application Framework - HOMEDRIVE and TEMP are undefined on UWP 

-  Notes
Vico Liang (developer)
2019-06-05 17:57

Below function is affected due to this issue. It will always returning false even if the folder exist.

Standard_Boolean CDF_FWOSDriver::Find(const TCollection_ExtendedString& aFolder,
                                         const TCollection_ExtendedString& aName,
                                         const TCollection_ExtendedString& /*aVersion*/)

  OSD_Path thePath=UTL::Path(aFolder);
  OSD_Directory theDirectory(thePath);
  if(theDirectory.Exists()) {
    TCollection_ExtendedString f(aFolder);
    OSD_Path p2 = UTL::Path(f);
    OSD_File theFile(p2);
    return theFile.Exists();
  return Standard_False;
Vico Liang (developer)
2019-06-06 05:39
edited on: 2019-06-06 05:41

This is not an occt issue, it's about UWP file accessing restriction. UWP don't allow file accessing outside sandbox. If the file inside sandbox, it will work. so this issue can be closed.

- Issue History
Date Modified Username Field Change
2019-06-05 17:51 Vico Liang New Issue
2019-06-05 17:51 Vico Liang Assigned To => abv
2019-06-05 17:53 Vico Liang Relationship added related to 0030761
2019-06-05 17:57 Vico Liang Note Added: 0084898
2019-06-06 05:39 Vico Liang Note Added: 0084903
2019-06-06 05:39 Vico Liang Note Edited: 0084903 View Revisions
2019-06-06 05:41 Vico Liang Note Edited: 0084903 View Revisions

Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker