bug-lilypond
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Issue 1644 in lilypond: get_working_directory () issue?


From: lilypond
Subject: Re: Issue 1644 in lilypond: get_working_directory () issue?
Date: Tue, 30 Aug 2011 17:00:23 +0000

Updates:
        Status: Fixed
        Labels: fixed_2_15_9

Comment #4 on issue 1644 by address@hidden: get_working_directory () issue?
http://code.google.com/p/lilypond/issues/detail?id=1644

Already fixed with commit
if the return value from getcwd is NULL then the getcwd failed and errno
is set to one of:
 EACCESS - didn't have permission to read or search some component of
the path
 ENOENT  - the current working directory has been unlinked

Both of these are rare, but could happen.

If they did happen, it would be kind to tell the user why the silly
thing failed, but the return value of a std::string doesn't allow for a
return value that would signal an error.   That means that the only
thing you can do to signal an error is throw.  (You could always return
some well known error value in the string that would be checked, but
that seems hokey.)  If you call get_working_directory, and it could
throw, then you would have to have a try catch block.  It's called from:

lily-parser-scheme.cc (ly_parse_file) which assumes it always succeeds
setup_paths in lily/relocate.cc which assumes it always succeeds

Both of them currently would have problems if the getcwd failed.  In
both cases, if you could abort with a meaningful error message about not
having access to the current directory, or the current directory no




reply via email to

[Prev in Thread] Current Thread [Next in Thread]