1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fixed a regression opening file handles introduced in e65ac0b

This commit is contained in:
ed 2020-03-16 10:19:56 +00:00
parent b9835d3a0c
commit 330df2b3e6

View file

@ -415,7 +415,7 @@ int64 juce_fileSetPosition (void* handle, int64 pos)
void FileInputStream::openHandle()
{
auto f = open (file.getFullPathName().toUTF8(), O_CREAT | O_RDONLY, 00644);
auto f = open (file.getFullPathName().toUTF8(), O_RDONLY);
if (f != -1)
fileHandle = fdToVoidPointer (f);
@ -452,7 +452,7 @@ void FileOutputStream::openHandle()
{
if (file.exists())
{
auto f = open (file.getFullPathName().toUTF8(), O_CREAT | O_RDWR, 00644);
auto f = open (file.getFullPathName().toUTF8(), O_RDWR);
if (f != -1)
{
@ -543,8 +543,12 @@ void MemoryMappedFile::openInternal (const File& file, AccessMode mode, bool exc
range.setStart (range.getStart() - (range.getStart() % pageSize));
}
fileHandle = open (file.getFullPathName().toUTF8(),
(O_CREAT | (mode == readWrite ? O_RDWR : O_RDONLY)), 00644);
auto filename = file.getFullPathName().toUTF8();
if (mode == readWrite)
fileHandle = open (filename, O_CREAT | O_RDWR, 00644);
else
fileHandle = open (filename, O_RDONLY);
if (fileHandle != -1)
{