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

Creating a file called . creates file in parent dir with the same name as the dir the file was created in #566

Open
booth-w opened this issue Jan 24, 2025 · 4 comments
Labels

Comments

@booth-w
Copy link
Contributor

booth-w commented Jan 24, 2025

Describe the bug
Creating a file called . creates one in the parent dir and names it the same name as parent with (1) at the end.

To Reproduce
Create dir. For example, test.
In test, create file ..
In the parent of test, there will now be dir test and file test(1).

Expected behavior
Creating a file called . should not be allowed.

System information (please complete the following information):

  • OS: Arch Linux
  • Version: 6.10.2-arch1-1
  • superfile Version: v1.1.7.1 (b157637)
@booth-w booth-w added the bug Something isn't working label Jan 24, 2025
@lazysegtree
Copy link
Collaborator

lazysegtree commented Jan 24, 2025

Reproduced bug in MacOS too

Image

Also passing .. also causes similiar behaviour but directory 2 level up is created as a new file.

@lazysegtree
Copy link
Collaborator

Behaviour of yazi - Warns about replacing the directory and doesn't do anything and pressing enters ( operation is ignored )

Image Image

@lazysegtree
Copy link
Collaborator

lazysegtree commented Jan 24, 2025

Any name that ends with . or .. (including xyz/../abc/.., ../. , ../.) will also cause such behaviour.
We should avoid ctrl+n operation in case of name either being . or .. , or ending with /. or /..
We cant avoid all names ending with . as abc. is valid.

Also need to consider the behaviour in windows.

@lazysegtree
Copy link
Collaborator

Thanks @booth-w for this bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants