grub-devel
[Top][All Lists]
Advanced

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

Re: test -e command for grub2


From: Hollis Blanchard
Subject: Re: test -e command for grub2
Date: Tue, 13 Jun 2006 09:01:38 -0500

On Tue, 2006-06-13 at 15:00 +0200, adrian15 wrote:
> I attach then new test.c for grub2. (I worked from Grub 1.94 version).
> 
> It only implements the test -e feature.
> I haven't been able to check it. ./configure says something about a LZO
> version.

You haven't even compiled it? Perhaps you should install the LZO
libraries you need.

> 1) Why cat uses the file = grub_gzfile_open (args[0], 1); sentence to
> check if a file can be opened or not? Is it cat supposed to cat also
> gzipped files?

I guess so.

> Is it better for me to use grub_gzfile_open on my test command?

Probably not, since you're just testing for existence.

> 2) I've done this:
> 
> static const struct grub_arg_option options[] =
>     {
>       {"file", 'e', 0, "test if a file exists", 0, 0},
>       {0, 0, 0, 0, 0, 0}
>     };
> 
> copying-pasting from search.c but I do not understand it too much... if
> this is repeated in test.c and search.c the compiler should complain...
> isn't it ?

No, it's static.

> 3) And you're free to tell to only attach patchs instead of the full 
> file... and you're free to tell me an url for a gnu c syntax or 
> convention as far as I do not know if the gnu project has any. And, of 
> course, tell me if it compiles or not.

Google for GNU Coding Style. Then, since that document is incomplete,
you will need to mimic the style you see elsewhere in GRUB.

> P.S.: I am going to update from Knoppix 4 to Knoppix 5 soon and I think 
> I won't hae the lzo problem.

Try installing the LZO development package on Knoppix 4.

-Hollis





reply via email to

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