[Top][All Lists]

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

Re: [PATCH 2/2] ls core command: handle listing of the root directory

From: Francesco Lavra
Subject: Re: [PATCH 2/2] ls core command: handle listing of the root directory
Date: Sat, 18 May 2013 12:26:17 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

On 05/12/2013 12:56 PM, Francesco Lavra wrote:
> Currently, listing of the root directory of a device with the command:
> ls (device_name)
> requires the underlying filesystem driver to handle an empty path 
> string as if it was the root directory path "/". This introduces 
> duplicated code across the different filesystem drivers. If a given 
> filesystem driver does not implement special handling of the empty 
> path string, the above command gives "error: invalid file name `'."
> This error happens for instance with the ext4 filesystem.
> The best place to handle correctly the empty path string and transform 
> it in "/" is the function grub_core_cmd_ls(), so that handling from 
> each filesystem driver is not required anymore.

After revision 5010, issuing the ls command with a device name as
parameter gives a response such as:
(device_name): Filesystem is <filesystem name>.
But grub.texi says:
@deffn Command ls [arg @dots{}]
List devices or files.

With no arguments, print all devices known to GRUB.

If the argument is a device name enclosed in parentheses (@pxref{Device
syntax}), then list all files at the root directory of that device.

If the argument is a directory given as an absolute file name (@pxref{File
name syntax}), then list the contents of that directory.
@end deffn

Which is the correct behavior?

reply via email to

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