Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


This is my first post to this mailing list, so I'd beg your indulgence if I'm
breaking any rules of list etiquette here.

When you invoke LibreOffice from the command line with the headless command
and try to convert a file to another format, the exit code of the command is
zero regardless of whether LibreOffice was actually able convert the file or
not. I wanted to get clarification on whether this was intentional or not. I
could see why this might make sense (LibreOffice didn't do what you wanted
to but it did open and close successfully) - but, not knowing enough about
the program I wasn't sure if this was an error or intended behavior.

I discovered this while invoking LibreOffice from within Python using
subprocess.check_call() but I've also tested it at the command line to be
sure.


The behavior I am talking about can be recreated as follows:
If you are on the command line, working in a directory with a file named
test.docx,

Successfully running the command:
$ libreoffice --headless --convert-to fodt test.docx
$ echo "$?"
0

Unsuccessfully running the command:
$ libreoffice --headless -- convert-to fodt not_an_actual_file.docx
$ echo "$?"
0

Thanks in advance for any input.



--
View this message in context: 
http://nabble.documentfoundation.org/Are-return-codes-implemented-tp4018980.html
Sent from the Discuss mailing list archive at Nabble.com.

-- 
Unsubscribe instructions: E-mail to discuss+help@documentfoundation.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.documentfoundation.org/www/discuss/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.