Skip to content

Commit

Permalink
Fix for OpenIfExisting option for CreateFile (#1309)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSoundy authored and josesimoes committed May 13, 2019
1 parent d23b191 commit 107845e
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -726,10 +726,16 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder::CreateFileNati
break;

case CreationCollisionOption_OpenIfExists:
// Open existing file & truncate
mode[0] = 'r';
mode[1] = '+';
break;
if (fileExists)
{
// Open existing file
mode[0] = 'r';
}
else
{
NANOCLR_SET_AND_LEAVE(CLR_E_FILE_NOT_FOUND);
}
break;

case CreationCollisionOption_GenerateUniqueName:
// this operation is not supported in nanoFramework
Expand Down

0 comments on commit 107845e

Please sign in to comment.