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

julia . does not fail #51791

Open
jakobnissen opened this issue Oct 20, 2023 · 4 comments
Open

julia . does not fail #51791

jakobnissen opened this issue Oct 20, 2023 · 4 comments

Comments

@jakobnissen
Copy link
Contributor

If a directory is passed as the script to julia, no error is raised, but nothing happens. Possibly a consequence of #36605.
Ideally, this should throw an error.

Example:

$ julia .
$

More insidious example

$ julia --startup=no --project . my_script arg1 arg2 arg3
$
@fredrikekre
Copy link
Member

The program (.) is empty

julia> read(pwd())
UInt8[]

See e.g. #36605.

@KristofferC
Copy link
Member

I think this can be closed as a dup since this is just a "downstream" effect of #36605

@jakobnissen
Copy link
Contributor Author

jakobnissen commented Oct 23, 2023

I disagree - currently, #36605 is not yet solved because checking whether a file is a directory is an expensive operation. So, that issue may be closed because it's deemed that the check is not worth it.
If it does, then this issue should still be addressed with a isdir check, since the overhead of checking whether a file is a directory is insignificant compared to starting Julia.
At least let's keep this open until we are 100% sure that the other issue will be fixed, even if a fix comes at the expense of opening files being slower.

@jakobnissen jakobnissen reopened this Oct 23, 2023
@vtjnash
Copy link
Member

vtjnash commented Oct 23, 2023

We could either make this an explicit check when loading source code, or we could try measuring performance of using faccessat to check for the ENOTDIR error as a quick isdir check when opening any file

#36605 (comment)

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

No branches or pull requests

4 participants