|
|
Thread Tools | Search this Thread |
07-30-2018, 12:50 AM | #1 |
Member
Posts: 14
Karma: 10
Join Date: Jul 2018
Device: Kindle 4
|
Why calibre transforms " : " and " .. " into just " _ "??. File name
Hi,
I am using the tool save to disc. And everytime theres a colon ( : ) or two dots together (..), calibre puts an underline. Let me give you two examples: In both examples, the template for name filing is: {author_sort}. {title} 1. A book with title name "Grammar test: Level 4" and author "John Smith". The file's name of this saved-to-disc ebook becomes: Smith, John. Grammar test_Level 4 Why that underline instead of the colon??? 2. A book with the title name "The greatest" and author "Tim R. Swan". The file's name of this saved-to-disc ebook becomes: Swan, Tim R_ The greatest Why that underline instead of to following dots??? Can anyone help me to fix it? |
07-30-2018, 01:37 AM | #2 |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
A colon is an illegal character in a file name under Windows. So, calibre can't create a file with a colon in its name and replaces it with an underscore. And it does this for any invalid character. For compatibility across all the OSes that calibre runs, it will probably use the same rules.
The trailing dot is related. For the examples I have seen, it is the last character before the dot separating the extension. Windows seems to be OK with this, so it might be another OS. Or maybe it is because it would be very confusing and cause all sorts of problems coding around having the dot at the end of a file name. In the example you gave, it isn't strictly necessary, but it probably is following a standard rule for file names. |
07-31-2018, 07:15 PM | #3 | |
Member
Posts: 14
Karma: 10
Join Date: Jul 2018
Device: Kindle 4
|
Quote:
Ok, about the colon. I understand now. There is no file in the whole windows that can have a colon in its name. Got it. But about the two dots or trailing dot " .. " , why calibre changes it for an underscore?? It is actually possible to create a file with " .. " in the file name in windows. |
|
07-31-2018, 07:35 PM | #4 | |
null operator (he/him)
Posts: 20,565
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Another consideration is that calibre libraries should be portable between different Operating System and File System combinations. BR |
|
10-29-2018, 05:39 PM | #5 |
Member
Posts: 14
Karma: 10
Join Date: Jul 2018
Device: Kindle 4
|
I just found out something that does not make sense :S
About when calibre changes ".." for "_". In the calibre library I have this ebook with this metadata: Author: Jens R. Hope Year: 2000 Title: Water. (please, pay special attention that the title ends up with a dot ".") Then I apply this code: Code:
{author_sort}. {title}{:'format_date (raw_field ('pubdate'),'yyyy')'|. |} Hope, Jens R_ Water.. 2000 As before, with {author_sort}, calibre transforms ".." into "_". BUT, AND HERE IT COMES THE CONTROVERSY: after {title}, calibre leaves ".." untouched. So it looks that IT IS possible for calibre to filename something with ".." in it. However, I've been playing with the code using many variations with for example "|. |" .. and I can't find a way to get this: Hope, Jens R.. Water.. 2000 How can I make calibre to leave untouched ".." also after {author_sort}?? |
10-29-2018, 06:57 PM | #6 | |
Bibliophagist
Posts: 35,359
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
* Actually, going back even further since Gary Kildall of CP/M borrowed his filenaming conventions. |
|
10-29-2018, 07:32 PM | #7 |
Well trained by Cats
Posts: 29,795
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
..\ tells the OS to go up 1 level closer to the root (Win and Linux)
.\ tells the OS to include the current directory name. a dot also separates the files name from the extension. and directories CAN have a dot part (just not common usage in windows) oh .filename in Linux are hidden Last edited by BetterRed; 10-29-2018 at 07:39 PM. Reason: nt -> not |
11-02-2018, 06:08 PM | #8 | |||
Member
Posts: 14
Karma: 10
Join Date: Jul 2018
Device: Kindle 4
|
Quote:
Quote:
So, I still dont understand how calibre DOES allow this (in blue) : Hope, Jens R_ Water..2000 (this is a real example) But it DOES NOT allows this (in red) : Hope, Jens R.. Water.. 2000 when using this template code: Code:
{author_sort}. {title}{:'format_date (raw_field ('pubdate'),'yyyy')'|. |} Quote:
|
|||
11-02-2018, 06:27 PM | #9 |
Well trained by Cats
Posts: 29,795
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Code:
..\ so you .. in the middle must be OK (Kovid would no mess up on things like this) there are other special characters that mean stuff to different OS. Kovid does KISS: one code to rule them all (even if it might be allowed buy x) |
11-02-2018, 07:49 PM | #10 |
null operator (he/him)
Posts: 20,565
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Latios would seem to have a point. If an Author's name ends in a dot (.) it seems to get a different treatment to a Title that ends in a dot (.),
On Windows/NTFS I created this book Then with these StD basic settings ... and this template Code:
{title}. {author_sort}. {:'format_date (raw_field ('pubdate'),'yyyy')'|. |} Code:
Hello_ Better Red_ . 2000.epub Code:
{author_sort}. {title}{:'format_date (raw_field ('pubdate'),'yyyy')'|. |} Code:
Better Red_ Hello.. 2000.epub BTW, in my Test library (which is the one I was using) I don't swap first and last names to create Author Sort. BR |
11-02-2018, 08:12 PM | #11 | |
....
Posts: 1,547
Karma: 18068960
Join Date: May 2012
Device: ....
|
Quote:
While two periods are allowed within filenames (as in your red example) by Windows (and I think by Linux too) I have never seen them so used and I suspect most people would do a double take if seen used by others; that if only because use of the second period normally adds nothing to the clarity of a filename (and, in Windows, it uses up one of the 260 path length characters total path and filename length for no purpose). A single period (and spaces) may add to the clarity of the filename (such as an author's name e.g. R. L. Stevenson) Many people regard it as bad practice to use any periods (or spaces) at all other than for the extension separator. As far as Windows users go this is a likely mainly a hangover from original DOS file naming days. Also as theducks has pointed out single and double periods have a specific use when preceded by a \ (or/). For myself I use the gamut of Windows allowed characters when naming files but I would not use double periods. When using spaces I normally consider whether their use may cause problems (e.g. a human typing a filename can accidently strike two spaces and not notice it - two spaces are allowed in Windows) in which case I use a Low Line instead. |
|
11-09-2018, 10:30 PM | #12 | ||
Member
Posts: 14
Karma: 10
Join Date: Jul 2018
Device: Kindle 4
|
Quote:
Quote:
It's just that I do not want a "_" basically because I have all my library superclean with all file names. and it bothers me like a lot to see that everytime I have an author with just the initial as second name (e.g: "R.", or "T."... etc)... calibre decides to add a "_" at the end of the author_sort... consequently making my library the opposite of clean. More visually, I mean that by using this template code: Code:
{author_sort}. {title}{:'format_date (raw_field ('pubdate'),'yyyy')'|. |} Code:
Cox, Jen. Green world. 1948 Smith, Jogh. Crystal water. 2010 Tim, Sam R_ Glass. 1999 Murphy, Melissa. Manual. 2008 So i just wanted to find a solution to create a template code to fix that, while at the same time leaving the rest as clean as it is.... call it OCD, yes. Last edited by Latios; 11-09-2018 at 10:34 PM. |
||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Apple Mac now have a file extension ".iba" for the program "iBooks Author." | brucehobson | Calibre | 3 | 09-15-2014 07:46 PM |
Custom column: "Updated date", when adding new "versions" of the same file? | enriquep | Library Management | 16 | 11-03-2011 10:46 AM |