MantisBT
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-07-08 14:08
ReporterVico Liang 
Assigned Tobugmaster 
PrioritynormalSeverityblock 
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version[OCCT] 7.4.0 
Target Version[OCCT] 7.4.0Fixed 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 ()
{
  myError.Reset();

 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);

 WIN32_FILE_ATTRIBUTE_DATA aFileInfo;

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

 return retVal;

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

- Relationships
related to 0030770closedbugmaster Foundation Classes - OSD_OpenFile always fails to open file on UWP 
related to 0030761verifiedbugmaster Application Framework - HOMEDRIVE and TEMP are undefined on UWP 

-  Notes
(0084898)
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);
    PutSlash(f);
    f+=aName;
    OSD_Path p2 = UTL::Path(f);
    OSD_File theFile(p2);
    return theFile.Exists();
  }
  return Standard_False;
}
(0084903)
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.

(0085241)
kgv (developer)
2019-06-24 09:25

Dear Bugmaster,

please close the issue.

- 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
2019-06-24 09:25 kgv Relationship added related to 0030770
2019-06-24 09:25 kgv Note Added: 0085241
2019-06-24 09:25 kgv Assigned To abv => bugmaster
2019-06-24 09:25 kgv Status new => feedback
2019-06-24 09:25 kgv Resolution open => no change required
2019-07-08 14:08 bugmaster Status feedback => closed


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker