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

Handle dots in directory names #12

Closed
paul-rogers opened this issue Jul 14, 2021 · 2 comments · Fixed by #16
Closed

Handle dots in directory names #12

paul-rogers opened this issue Jul 14, 2021 · 2 comments · Fixed by #16
Labels
enhancement New feature or request

Comments

@paul-rogers
Copy link

Great addition to Linux Mint!

I have a set of directories with names like foo.bar-abc, foo.bar-def. I want to remove the foo.bar part. However, Bulky seems to think the dot is an extension. If I try to "Rename", then "foo.bar-" won't match anything. If I try to "Remove", then Bulky removes n characters from both the "foo" part and the "bar-" part, leaving, when n=2, "o.r-def". If I choose name-only, then the removing stops at the dot so that, even if I ask to remove 8 characters, I'm left with ".bar-abc", etc.

What I expected was that, in Replace mode, if I type "foo.bar-" in the Find field, and nothing in the Replace field, that the prefix would be removed, even if it happens to include a dot. In addition to the three choices now ("Name only", "Extension only" and "Name and Extension"), should there also be an option for "Ignore Extension"? Or, auto-ignore extensions on directory names? (Though, we'd still want to do this for file names, see below.)

A workaround is to first replace the "foo" portion using "Name only" with blanks, leaving ".bar-abc" etc. Then, switch to "Extension Only" and replace ".bar-" with blank. This leaves me with ".abc", ".def", which is not quite what I wanted (I wanted to remove the dot, which is not an extension here.)

The key is that, in Linux, unlike Windows, the dot is not special; it is just a convention that is often followed to indicate an extension, but it is perfectly valid to use the dot elsewhere, especially in directory names. Imagine server logs with an IP address: 123.456.789.abc.log or in domain names foo.com.log.

Thanks!

@mtwebster mtwebster added the enhancement New feature or request label Jul 14, 2021
@Piiit
Copy link

Piiit commented Aug 5, 2021

@mtwebster
Hi, I have the same issue. The Find contains "it.bz.beacon" in the first screenshot, and "it.bz.beacon." in the second. Replace is empty.

Please see the following screenshots:

This one is working, because I leave the last dot (same for Name only, Name + Extension dropdown selection):
Selection_101

Here, I think the pattern matching assumes the last dot separates the extension, but folders do not have extensions:
Selection_102

I suggest that for files, the option "Name + Extension" should not tread the last dot as something special, and for folders this should be the default for all dropdown selection. I talk about the right dropdown...

I would consider this a bug, not an enhancement... because it is not correct for folders IMO. Other than that it is a very useful addition to nemo... thanks for that.

Cheers

@mtwebster
Copy link
Member

Unzip this and copy to /usr/lib/bulky:

bulky.zip

I think this is what you want, if you select name+extension

mtwebster added a commit to mtwebster/bulky that referenced this issue Aug 5, 2021
This renames (and changes the behavior of) the "Name and extension"
scope to "Full name".

Instead of this option modifying the name and extension as separate
strings, it will now work with the full file name.

This scope will be activated and enforced whenever at least one
folder is part of the file list.

Small tweak: Disable the "Rename" button if there are no actual
changes pending.

Fixes linuxmint#12
mtwebster added a commit that referenced this issue Nov 16, 2021
This renames (and changes the behavior of) the "Name and extension"
scope to "Full name".

Instead of this option modifying the name and extension as separate
strings, it will now work with the full file name.

This scope will be activated and enforced whenever at least one
folder is part of the file list.

Small tweak: Disable the "Rename" button if there are no actual
changes pending.

Fixes #12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

3 participants