Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow IO #6023

Merged
merged 5 commits into from
Feb 8, 2024
Merged

Slow IO #6023

merged 5 commits into from
Feb 8, 2024

Conversation

pkriens
Copy link
Member

@pkriens pkriens commented Feb 7, 2024


Signed-off-by: Peter Kriens [email protected]

- fixed the getBasedFile to not use canonical files since they were not needed
- Made classes for Windows and Other oses
Fixes bndtools#6014

---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
Copy link
Contributor

@jukzi jukzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are better off resolving relative against base an then check if its still legal

@pkriens
Copy link
Member Author

pkriens commented Feb 8, 2024

you are better off resolving relative against base an then check if its still legal

I disagree. It is the responsibility of the caller to make sure the base is ok. Eclipse file systems and Java file systems and the OS file systems interact in horrible ways. See how hard the testing of this is, especially on windows.

The thing I learned here is that the new File(base,path) will ensure that any absolute file will always be a child of base. From the doc:

If the {@code child} pathname string is absolute then it is converted into a relative pathname in a system-dependent way.

I.e. unless base is null, new File(base,child) will therefore always return a child of base.

---
 Signed-off-by: Peter Kriens <[email protected]>

Signed-off-by: Peter Kriens <[email protected]>
@pkriens pkriens force-pushed the issue/6014-slow-io branch from cab3866 to 62e703b Compare February 8, 2024 11:00
Copy link
Contributor

@jukzi jukzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I.e. unless base is null, new File(base,child) will therefore always return a child of base.

not really intuitive.
Thanks for caring about the issues. looks like the tests are sufficient

@pkriens
Copy link
Member Author

pkriens commented Feb 8, 2024

thanks for the collaboration

@pkriens pkriens closed this Feb 8, 2024
@pkriens pkriens reopened this Feb 8, 2024
@pkriens pkriens merged commit ba25e82 into bndtools:master Feb 8, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[win] slow IO.getBasedFile
2 participants