[Top][All Lists]

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

Re: lua '' does not return message text

From: edgar . soldin
Subject: Re: lua '' does not return message text
Date: Sun, 17 Jan 2010 01:21:30 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20091204 Thunderbird/3.0

thanks .. I am gonna double check this. Are their other undocumented variables like grub_errmsg. Where should I look for documentation? I'd also look at the source if necessary.

About what I am doing. I found the listiso scripts
while trying to get them up and running they silently died because of missing modules. Essentially I wanted to parse lsmod. Because that's currently not possible I simply check if insmod fails or not.

Do you have an idea on how to parse output in the current state of the lua module?

Thanks again .. ede

On 17.01.2010 00:48, Jordan Uggla wrote:
On Thu, Jan 14, 2010 at 1:12 PM,<address@hidden>  wrote:
When I run

err,msg ="ls")

only the variable err is filled with the exit code.
msg is still nil .. I saw documentation that is supposed to return
the output in the second variable.

In the latest bzr ( pushed a few minutes ago ) the interface matches
what is documented in . Be careful
though, it's only the error message that is returned, not the output
of "ls". And an error message is only returned if there is an error.
For example:

errno, err_msg = "ls /boot") --Outputs "grub/"
print( errno, err_msg ) -- Outputs "0        nil"

errno, err_msg = "ls /boot/nonexistent" ) -- Outputs nothing
print( errno, err_msg ) -- Outputs "5        file not found"

If you want to actually list and store devices / files from lua you
should use grub.enum_device() and grub.enum_file() .

reply via email to

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