NSFS | GPFS | PUT OBJECT | Fix for upload object of nested key - temp file flow #7227
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explain the changes
On PUT OBJECT of nested key (a/b) on GPFS namespace resource - the directory a/ was not created due to setting open_path = dirname(open_path), According to https://nodejs.org/api/path.html#pathdirnamepath - dirname(path) returns directory name of a path, similar to the Unix dirname command. Trailing directory separators are ignored.
Removing the last '/' caused make_path_dirs() to not create a/ because it's searching for the last index of '/' of the path.
Example -
open_path = 'a/b';
open_path = dirname(open_path); // = 'a'
make_path_dirs -> no '/' - nothing to create
Took Guy's code to fix this issue -
Issues: Fixed #xxx / Gap #xxx
Testing Instructions: