Skip to main content
Known Participant
January 12, 2016
Answered

IDFile Mac OSX

  • January 12, 2016
  • 2 replies
  • 481 views

Please find out on MAC OSX development.

The below code GetIDFile() does not work and it totally crash the XCode 5.02.

I need to know what to fix in the code so I can open the file stream,  Or

There is another alternative to open the stream and read in the file.

PMString tmp("/Users/Sam/Desktop/Images/car/CarVDP.csv");

tmp.SetTranslatable(false);

SDKFileHelper fileHelper(tmp);

IDFile idfile = fileHelper.GetIDFile(); //Crash on MAC OSX

InterfacePtr<IPMStream> stream(StreamUtil::CreateFileStreamRead(idfile));

ASSERT(stream);

if (!stream) {

     return inout;

}

Thanks,

Sam

This topic has been closed for replies.
Correct answer Norio Kawamura

Use ':' instead of '/' as PathSeparator.

  IDFile idFile;

  PMString pathStr(":Users:Sam:Desktop:Images:car:CarVDP.csv");

  pathStr.SetTranslatable(false);

  FileUtils::PMStringToIDFile(pathStr, idFile);

  if (FileUtils::DoesFileExist(idFile)) {

  IPMStream* iPMStream = StreamUtil::CreateFileStreamRead(idFile);

  if (iPMStream != nil) {

  …

  }

  }

2 replies

Sam_Chan2Author
Known Participant
January 13, 2016

Thank you.

Norio KawamuraCorrect answer
Inspiring
January 13, 2016

Use ':' instead of '/' as PathSeparator.

  IDFile idFile;

  PMString pathStr(":Users:Sam:Desktop:Images:car:CarVDP.csv");

  pathStr.SetTranslatable(false);

  FileUtils::PMStringToIDFile(pathStr, idFile);

  if (FileUtils::DoesFileExist(idFile)) {

  IPMStream* iPMStream = StreamUtil::CreateFileStreamRead(idFile);

  if (iPMStream != nil) {

  …

  }

  }