Multi-Rename Tool - "." > "_"

English support forum

Moderators: Hacker, petermad, Stefan2, white

User avatar
TLis
Member
Member
Posts: 111
Joined: 2004-06-02, 16:48 UTC
Location: Szczecin, Poland

Post by *TLis »

Stefan2 wrote:
Sir_SiLvA wrote:
kwanbis wrote:last dot from the left separates the extension.
And what if you got a file like <document>.doc.tmp ? :)
...
Then .tmp is the extension just now.
Exactly! This is the way Windows recognises file extensions, for example by showing the appropriate icon by the file name in the explorer. If for a Word document you change the file name adding a .tmp extension, this file will no longer be recognised by Windows as a Word document. Let's be clear on it. The extension is the last part of the file name, starting with a dot (first from the right / last from the left). If there is no dot in the file name, the file has no extension (empty extension?).

See for example http://filext.com/faq/file_extension_information.php:
The basic form of a filename is:

rootname.ext

The first part of the name to the left of the period is called the root name. The root name cannot be the same as a device name. The second part to the right of the period is the extension. It is optional and is often, but not necessarily, three characters long. Under MS-DOS the rootname could only be eight characters long and the extension no more than three so three characters (or less) is often still the default although under Windows 95 and above that limit is now gone. Some still use three characters for files that must be backward compatible for still-running DOS-based systems.

The period is used between the root name and extension and must be present if there is an extension. The root name under Windows may contain multiple periods. Only the last one is the divider between the root name and extension.
User avatar
kwanbis
Junior Member
Junior Member
Posts: 68
Joined: 2006-11-06, 21:30 UTC

Post by *kwanbis »

Sir_SiLvA wrote:
I donate this code to Ghisler, so he can properly identify the extension ;) (i'm sure he has better code)
No need for that - Delphi has it own function to cut Get the File-Extension...
That if IRCC, goes MAD with multiple dots on a file name.

Try it.
StatusQuo
Power Member
Power Member
Posts: 1524
Joined: 2007-01-17, 21:36 UTC
Location: Germany

Post by *StatusQuo »

TLis wrote:
The root name under Windows may contain multiple periods. Only the last one is the divider between the root name and extension.
I fully agree - but unfortunately it doesn't seem that simple in every case, at least when using wildcards... :roll:
Some weird thread about how multiple dots can be treated (including test results for renaming in TC vs. DOS-Box):
http://ghisler.ch/board/viewtopic.php?p=21712#21712
Who the hell is General Failure, and why is he reading my disk?
-- TC starter menu: Fast yet descriptive command access!
User avatar
Sam_Zen
Power Member
Power Member
Posts: 700
Joined: 2005-02-08, 22:59 UTC
Location: NL
Contact:

Post by *Sam_Zen »

The fact that this discussion continues with different aspects about it, emphasises my point I think : Avoid using multiple dots.
0.618033988
User avatar
Lefteous
Power Member
Power Member
Posts: 9537
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

This is what Microsoft says about naming files:
http://msdn2.microsoft.com/en-us/library/aa365247.aspx
User avatar
Sam_Zen
Power Member
Power Member
Posts: 700
Joined: 2005-02-08, 22:59 UTC
Location: NL
Contact:

Post by *Sam_Zen »

Not only some single characters are better to avoid in a filename. So are still a list of strings better not to use as a filename.
Quote:
Do not use the following reserved device names for the name of a file: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9. Also avoid these names followed by an extension, for example, NUL.tx7.
End quote.
The machine has its demands too. So better adjust to it, to keep things elegant.
I once searched on the domain-database for the name 'com' and the engine went berserk.
0.618033988
User avatar
kwanbis
Junior Member
Junior Member
Posts: 68
Joined: 2006-11-06, 21:30 UTC

Post by *kwanbis »

Sam_Zen wrote:The fact that this discussion continues with different aspects about it, emphasises my point I think : Avoid using multiple dots.
The point is that i do avoid them. If you read what we are asking, is for a way of removing dots from the file name, without breaking the extension.

And is a simple FIX.
User avatar
Sam_Zen
Power Member
Power Member
Posts: 700
Joined: 2005-02-08, 22:59 UTC
Location: NL
Contact:

Post by *Sam_Zen »

I'm aware of the topic. Thanks. :)
0.618033988
Post Reply