Skip to content

Commit

Permalink
Add recursive to create a file in case of missing parent directory
Browse files Browse the repository at this point in the history
Add recursive to create a file in case of missing parent directory

pr-link: #14216
change-id: cid-60597171d723b471ce421f73d727f2ff9937ca95
  • Loading branch information
yyongycy committed Oct 11, 2021
1 parent 0892405 commit 0ba1baf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ protected int applyOperation() throws IOException, AlluxioException {
case WRITE: {
if (mOutStream == null) {
mOutStream = mFs.createFile(new AlluxioURI(mFilePath.toString()),
CreateFilePOptions.newBuilder().setBlockSizeBytes(mBlockSize)
CreateFilePOptions.newBuilder().setBlockSizeBytes(mBlockSize).setRecursive(true)
.build());
}
int bytesToWrite = (int) Math.min(mFileSize - mOutStream.getBytesWritten(),
Expand Down

0 comments on commit 0ba1baf

Please sign in to comment.