Fixed to truncate by default. Fixed permissions to default to 664.

git-svn-id: svn://10.0.0.236/trunk@65967 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
warren%netscape.com
2000-04-14 09:32:24 +00:00
parent e9324d307b
commit 9edaccbdac
3 changed files with 4 additions and 4 deletions

View File

@@ -474,7 +474,7 @@ nsJARChannel::EnsureJARFileAvailable(OnJARFileAvailableFun onJARFileAvailable,
// use a file transport to serve as a data pump for the download (done
// on some other thread)
rv = fts->CreateTransport(jarCacheFile, PR_WRONLY | PR_CREATE_FILE, 0,
rv = fts->CreateTransport(jarCacheFile, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE, 0664,
getter_AddRefs(mJarCacheTransport));
if (NS_FAILED(rv)) goto error;
rv = mJarCacheTransport->SetBufferSegmentSize(mBufferSegmentSize);

View File

@@ -418,8 +418,8 @@ nsFileOutputStream::Init(nsIFile* file, PRInt32 ioFlags, PRInt32 perm)
nsCOMPtr<nsILocalFile> localFile = do_QueryInterface(file, &rv);
if (NS_FAILED(rv)) return rv;
if (ioFlags == -1)
ioFlags = PR_WRONLY | PR_CREATE_FILE;
if (perm == -1)
ioFlags = PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE;
if (perm <= 0)
perm = 0664;
return localFile->OpenNSPRFileDesc(ioFlags, perm, &mFD);
}

View File

@@ -474,7 +474,7 @@ nsJARChannel::EnsureJARFileAvailable(OnJARFileAvailableFun onJARFileAvailable,
// use a file transport to serve as a data pump for the download (done
// on some other thread)
rv = fts->CreateTransport(jarCacheFile, PR_WRONLY | PR_CREATE_FILE, 0,
rv = fts->CreateTransport(jarCacheFile, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE, 0664,
getter_AddRefs(mJarCacheTransport));
if (NS_FAILED(rv)) goto error;
rv = mJarCacheTransport->SetBufferSegmentSize(mBufferSegmentSize);