01-03-2017, 04:02 PM | #1 |
Guru
Posts: 732
Karma: 3911762
Join Date: Jun 2006
Location: Toronto
Device: Kobo Libra 2, Clara 2E, and Clara HD; Kindle PaperWhite
|
ebook-viewer and 8.3 DOS short filenames
I love Calibre's ebook-viewer.exe, but I also love old software and sometimes use a DOS file-management shell [ProFinder, which came bundled with WordStar for DOS] that can only pass on short filenames (8.3-style) to other programs, such that an ebook file with this name:
Quantum Night - Robert J. Sawyer.epub has its named passed on to the Calibre ebook viewer as: QUANTU~1.EPU The problem, of course, is the extension .EPU, because the Calibre ebook-viewer.exe doesn't recognize it, and so gives this error message: ERROR: Could not open ebook ValueError: No plugin to handle input format: epu Would it be possible to add the ability for the ebook viewer to recognize .epu as a valid synonym for the extension .epub? Thank you so, so much! |
01-03-2017, 04:47 PM | #2 |
null operator (he/him)
Posts: 20,954
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
A better way might be for you to associate .EPU with calibre's ebook-viewer.exe via your OS. BTW, the ebook-viewer code is frozen, that means bug fixes only.
BR |
Advert | |
|
01-03-2017, 05:07 PM | #3 |
Resident Curmudgeon
Posts: 76,044
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
That won't work. The code for ebook-viewer works on the file extension. It does not check the file. It works on .epub is ePub and .epu is unknown. So unless there's a way to pass .epub instead of .epu, using ProFinder is out. The only way to solve this problem is to modify the code so .epu is ePub.
|
01-03-2017, 05:47 PM | #4 | |
null operator (he/him)
Posts: 20,954
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
@RobertJSawyer - sorry for the bum steer. If you set up a file association to the Azardi ebook viewer for .EPU it will work, Readium can also open a .EPU - assuming its a valid ePub of course. But ADE and the calibre will only open .EPUB's BR |
|
01-03-2017, 09:04 PM | #5 |
creator of calibre
Posts: 44,408
Karma: 23977332
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The problem with doing that is that in the future .epu might be used for some non-epub file type, in which case trying to open it would be the wrong thing to do.
|
Advert | |
|
01-04-2017, 01:19 AM | #6 |
null operator (he/him)
Posts: 20,954
Karma: 27620688
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
.EPU is already known. It's used by commercially available software from DGMR, a civil engineering consultancy based in the Netherlands.
BR |
01-04-2017, 10:27 AM | #7 |
Guru
Posts: 732
Karma: 3911762
Join Date: Jun 2006
Location: Toronto
Device: Kobo Libra 2, Clara 2E, and Clara HD; Kindle PaperWhite
|
Thank you for your replies, everybody.
Of course, I'm NOT looking to have the extension .epu associated via Windows Explorer or the Windows registry with ebook-viewer.exe; that's both inappropriate and unnecessary. All I was hoping for is that if ebook-viewer.exe encounters a standard Windows/DOS short filename in the 8.3 format as a command-line argument when ebook-viewer.exe is being called, which, as Windows itself will style it, has the .epu extension, that ebook-viewer.exe would recognize it instead of rejecting it. No part of calibre would ever try to steal the file association from any present or future program that used the .epu extension. Thanks! Last edited by RobertJSawyer; 01-04-2017 at 10:35 AM. |
01-04-2017, 12:30 PM | #8 |
Wizard
Posts: 1,265
Karma: 10203040
Join Date: Dec 2011
Device: a variety (mostly kindles and kobos)
|
The following "wrapper" batch file will convert the 8.3 filename back to the long version and then call ebook-viewer.exe with it:
Code:
@echo off REM VIEWER.BAT - a wrapper for Calibre's ebook-viewer.exe REM REM This script expects a filename in 8.3 format, it will REM convert it to a long filename and call ebook-viewer if "%1" == "" ( echo VIEWER.BAT - Missing filename goto :eof ) REM get the directory name of the filename passed in FOR /f "tokens=*" %%A IN ('echo %~dp1') DO ( set DIR_NAME=%%A ) REM convert filename to long format FOR /f "tokens=*" %%A IN ('dir /b %1') DO ( set LONG_NAME=%%A ) REM pass the full filename to ebook-viewer REM Change the path to Calibre if necessary "C:\Program Files (x86)\Calibre2\ebook-viewer.exe" "%DIR_NAME%\%LONG_NAME%" |
01-04-2017, 12:48 PM | #9 |
Guru
Posts: 732
Karma: 3911762
Join Date: Jun 2006
Location: Toronto
Device: Kobo Libra 2, Clara 2E, and Clara HD; Kindle PaperWhite
|
latepaul, thank you so, so much! This does the trick. I'm very, very grateful for your help!
All best wishes -- and Happy New Year! |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pre-Import ebook with Filenames to custom column? | yonkyunior | Library Management | 2 | 12-26-2015 06:42 PM |
DOs and DON'Ts of ebook cover design | amoroso | Writers' Corner | 37 | 07-27-2011 03:17 AM |
[old-topic]ebook-viewer: Open source, crossplatform viewer for EPUB, LIT, MOBI, etc | kovidgoyal | Calibre | 68 | 05-30-2011 08:46 PM |
# user css for viewer.py/ ebook-viewer/ prs-650 | tscamera | Calibre | 0 | 01-02-2011 06:28 PM |
Filenames to metadata, preserving filenames. | nitrogun | Calibre | 5 | 09-13-2010 10:50 PM |