grub-devel
[Top][All Lists]
Advanced

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

Re: lua 'grub.run' does not return message text


From: Jordan Uggla
Subject: Re: lua 'grub.run' does not return message text
Date: Sat, 16 Jan 2010 15:48:32 -0800

On Thu, Jan 14, 2010 at 1:12 PM,  <address@hidden> wrote:
> When I run
>
> err,msg = grub.run("ls")
>
> only the variable err is filled with the exit code.
> msg is still nil .. I saw documentation that grub.run 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 http://grub.enbug.org/LUASupport . 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 = grub.run( "ls /boot") --Outputs "grub/"
print( errno, err_msg ) -- Outputs "0        nil"

errno, err_msg = grub.run( "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() .

-- 
Jordan Uggla ( Jordan_U on irc.freenode.net )




reply via email to

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