* [PATCH] ShellPkg ShellLib.h: Fix wrong parameter name for ShellOpenFileByName
@ 2018-09-29 9:42 Star Zeng
2018-09-30 1:11 ` Ni, Ruiyu
0 siblings, 1 reply; 4+ messages in thread
From: Star Zeng @ 2018-09-29 9:42 UTC (permalink / raw)
To: edk2-devel; +Cc: Star Zeng, Ruiyu Ni, Jaben Carsey
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1221
The parameter name FilePath should be FileName.
I am trying to write an application for my own use and want to use
this interface, but confused by the parameter name.
Interesting, the implementation in UefiShellLib.c is correct.
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
---
ShellPkg/Include/Library/ShellLib.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ShellPkg/Include/Library/ShellLib.h b/ShellPkg/Include/Library/ShellLib.h
index 92fddc50f5dd..d6a5319285dd 100644
--- a/ShellPkg/Include/Library/ShellLib.h
+++ b/ShellPkg/Include/Library/ShellLib.h
@@ -126,7 +126,7 @@ ShellOpenFileByDevicePath(
otherwise, the Filehandle is NULL. Attributes is valid only for
EFI_FILE_MODE_CREATE.
- @param[in] FilePath The pointer to file name.
+ @param[in] FileName The pointer to file name.
@param[out] FileHandle The pointer to the file handle.
@param[in] OpenMode The mode to open the file with.
@param[in] Attributes The file's file attributes.
@@ -151,7 +151,7 @@ ShellOpenFileByDevicePath(
EFI_STATUS
EFIAPI
ShellOpenFileByName(
- IN CONST CHAR16 *FilePath,
+ IN CONST CHAR16 *FileName,
OUT SHELL_FILE_HANDLE *FileHandle,
IN UINT64 OpenMode,
IN UINT64 Attributes
--
2.7.0.windows.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ShellPkg ShellLib.h: Fix wrong parameter name for ShellOpenFileByName
2018-09-29 9:42 [PATCH] ShellPkg ShellLib.h: Fix wrong parameter name for ShellOpenFileByName Star Zeng
@ 2018-09-30 1:11 ` Ni, Ruiyu
2018-09-30 1:20 ` Zeng, Star
0 siblings, 1 reply; 4+ messages in thread
From: Ni, Ruiyu @ 2018-09-30 1:11 UTC (permalink / raw)
To: Zeng, Star, edk2-devel@lists.01.org; +Cc: Carsey, Jaben
Star,
Per my understanding, FilePath means the full path pointing to the file,
FileName means the very last part of the full path.
E.g.: "fs0:\a\b\c\d.txt" is a FilePath, "d.txt" is a FileName.
So I think only specifying FileName is not enough to identify a file.
The parameter name should be fine.
> -----Original Message-----
> From: Zeng, Star
> Sent: Saturday, September 29, 2018 5:43 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>; Carsey,
> Jaben <jaben.carsey@intel.com>
> Subject: [PATCH] ShellPkg ShellLib.h: Fix wrong parameter name for
> ShellOpenFileByName
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1221
>
> The parameter name FilePath should be FileName.
>
> I am trying to write an application for my own use and want to use this interface,
> but confused by the parameter name.
>
> Interesting, the implementation in UefiShellLib.c is correct.
>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jaben Carsey <jaben.carsey@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
> ShellPkg/Include/Library/ShellLib.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ShellPkg/Include/Library/ShellLib.h
> b/ShellPkg/Include/Library/ShellLib.h
> index 92fddc50f5dd..d6a5319285dd 100644
> --- a/ShellPkg/Include/Library/ShellLib.h
> +++ b/ShellPkg/Include/Library/ShellLib.h
> @@ -126,7 +126,7 @@ ShellOpenFileByDevicePath(
> otherwise, the Filehandle is NULL. Attributes is valid only for
> EFI_FILE_MODE_CREATE.
>
> - @param[in] FilePath The pointer to file name.
> + @param[in] FileName The pointer to file name.
> @param[out] FileHandle The pointer to the file handle.
> @param[in] OpenMode The mode to open the file with.
> @param[in] Attributes The file's file attributes.
> @@ -151,7 +151,7 @@ ShellOpenFileByDevicePath( EFI_STATUS EFIAPI
> ShellOpenFileByName(
> - IN CONST CHAR16 *FilePath,
> + IN CONST CHAR16 *FileName,
> OUT SHELL_FILE_HANDLE *FileHandle,
> IN UINT64 OpenMode,
> IN UINT64 Attributes
> --
> 2.7.0.windows.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ShellPkg ShellLib.h: Fix wrong parameter name for ShellOpenFileByName
2018-09-30 1:11 ` Ni, Ruiyu
@ 2018-09-30 1:20 ` Zeng, Star
2018-10-01 14:36 ` Carsey, Jaben
0 siblings, 1 reply; 4+ messages in thread
From: Zeng, Star @ 2018-09-30 1:20 UTC (permalink / raw)
To: Ni, Ruiyu, edk2-devel@lists.01.org; +Cc: Carsey, Jaben, Zeng, Star
Ray,
Thanks.
I did not check the detail. But at least, one of definition and implementation needs to be updated. Maybe the description need to be enhanced also as you described.
ShellLib.h:
EFI_STATUS
EFIAPI
ShellOpenFileByDevicePath(
IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,
OUT SHELL_FILE_HANDLE *FileHandle,
IN UINT64 OpenMode,
IN UINT64 Attributes
);
EFI_STATUS
EFIAPI
ShellOpenFileByName(
IN CONST CHAR16 *FilePath,
OUT SHELL_FILE_HANDLE *FileHandle,
IN UINT64 OpenMode,
IN UINT64 Attributes
);
UefiShellLib.c:
EFI_STATUS
EFIAPI
ShellOpenFileByDevicePath(
IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,
OUT SHELL_FILE_HANDLE *FileHandle,
IN UINT64 OpenMode,
IN UINT64 Attributes
)
EFI_STATUS
EFIAPI
ShellOpenFileByName(
IN CONST CHAR16 *FileName,
OUT SHELL_FILE_HANDLE *FileHandle,
IN UINT64 OpenMode,
IN UINT64 Attributes
)
Star
-----Original Message-----
From: Ni, Ruiyu
Sent: Sunday, September 30, 2018 9:12 AM
To: Zeng, Star <star.zeng@intel.com>; edk2-devel@lists.01.org
Cc: Carsey, Jaben <jaben.carsey@intel.com>
Subject: RE: [PATCH] ShellPkg ShellLib.h: Fix wrong parameter name for ShellOpenFileByName
Star,
Per my understanding, FilePath means the full path pointing to the file, FileName means the very last part of the full path.
E.g.: "fs0:\a\b\c\d.txt" is a FilePath, "d.txt" is a FileName.
So I think only specifying FileName is not enough to identify a file.
The parameter name should be fine.
> -----Original Message-----
> From: Zeng, Star
> Sent: Saturday, September 29, 2018 5:43 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>;
> Carsey, Jaben <jaben.carsey@intel.com>
> Subject: [PATCH] ShellPkg ShellLib.h: Fix wrong parameter name for
> ShellOpenFileByName
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1221
>
> The parameter name FilePath should be FileName.
>
> I am trying to write an application for my own use and want to use
> this interface, but confused by the parameter name.
>
> Interesting, the implementation in UefiShellLib.c is correct.
>
> Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> Cc: Jaben Carsey <jaben.carsey@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Star Zeng <star.zeng@intel.com>
> ---
> ShellPkg/Include/Library/ShellLib.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ShellPkg/Include/Library/ShellLib.h
> b/ShellPkg/Include/Library/ShellLib.h
> index 92fddc50f5dd..d6a5319285dd 100644
> --- a/ShellPkg/Include/Library/ShellLib.h
> +++ b/ShellPkg/Include/Library/ShellLib.h
> @@ -126,7 +126,7 @@ ShellOpenFileByDevicePath(
> otherwise, the Filehandle is NULL. Attributes is valid only for
> EFI_FILE_MODE_CREATE.
>
> - @param[in] FilePath The pointer to file name.
> + @param[in] FileName The pointer to file name.
> @param[out] FileHandle The pointer to the file handle.
> @param[in] OpenMode The mode to open the file with.
> @param[in] Attributes The file's file attributes.
> @@ -151,7 +151,7 @@ ShellOpenFileByDevicePath( EFI_STATUS EFIAPI
> ShellOpenFileByName(
> - IN CONST CHAR16 *FilePath,
> + IN CONST CHAR16 *FileName,
> OUT SHELL_FILE_HANDLE *FileHandle,
> IN UINT64 OpenMode,
> IN UINT64 Attributes
> --
> 2.7.0.windows.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ShellPkg ShellLib.h: Fix wrong parameter name for ShellOpenFileByName
2018-09-30 1:20 ` Zeng, Star
@ 2018-10-01 14:36 ` Carsey, Jaben
0 siblings, 0 replies; 4+ messages in thread
From: Carsey, Jaben @ 2018-10-01 14:36 UTC (permalink / raw)
To: Zeng, Star, Ni, Ruiyu, edk2-devel@lists.01.org
I think we need to update description. I guess that OpenFileByName may search CWD and or PATH, but DevicePath is absolute and therefore will not..
> -----Original Message-----
> From: Zeng, Star
> Sent: Saturday, September 29, 2018 6:20 PM
> To: Ni, Ruiyu <ruiyu.ni@intel.com>; edk2-devel@lists.01.org
> Cc: Carsey, Jaben <jaben.carsey@intel.com>; Zeng, Star
> <star.zeng@intel.com>
> Subject: RE: [PATCH] ShellPkg ShellLib.h: Fix wrong parameter name for
> ShellOpenFileByName
> Importance: High
>
> Ray,
>
> Thanks.
>
> I did not check the detail. But at least, one of definition and implementation
> needs to be updated. Maybe the description need to be enhanced also as
> you described.
>
> ShellLib.h:
>
> EFI_STATUS
> EFIAPI
> ShellOpenFileByDevicePath(
> IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,
> OUT SHELL_FILE_HANDLE *FileHandle,
> IN UINT64 OpenMode,
> IN UINT64 Attributes
> );
>
> EFI_STATUS
> EFIAPI
> ShellOpenFileByName(
> IN CONST CHAR16 *FilePath,
> OUT SHELL_FILE_HANDLE *FileHandle,
> IN UINT64 OpenMode,
> IN UINT64 Attributes
> );
>
>
> UefiShellLib.c:
>
> EFI_STATUS
> EFIAPI
> ShellOpenFileByDevicePath(
> IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath,
> OUT SHELL_FILE_HANDLE *FileHandle,
> IN UINT64 OpenMode,
> IN UINT64 Attributes
> )
>
> EFI_STATUS
> EFIAPI
> ShellOpenFileByName(
> IN CONST CHAR16 *FileName,
> OUT SHELL_FILE_HANDLE *FileHandle,
> IN UINT64 OpenMode,
> IN UINT64 Attributes
> )
>
> Star
> -----Original Message-----
> From: Ni, Ruiyu
> Sent: Sunday, September 30, 2018 9:12 AM
> To: Zeng, Star <star.zeng@intel.com>; edk2-devel@lists.01.org
> Cc: Carsey, Jaben <jaben.carsey@intel.com>
> Subject: RE: [PATCH] ShellPkg ShellLib.h: Fix wrong parameter name for
> ShellOpenFileByName
>
> Star,
> Per my understanding, FilePath means the full path pointing to the file,
> FileName means the very last part of the full path.
> E.g.: "fs0:\a\b\c\d.txt" is a FilePath, "d.txt" is a FileName.
>
> So I think only specifying FileName is not enough to identify a file.
> The parameter name should be fine.
>
> > -----Original Message-----
> > From: Zeng, Star
> > Sent: Saturday, September 29, 2018 5:43 PM
> > To: edk2-devel@lists.01.org
> > Cc: Zeng, Star <star.zeng@intel.com>; Ni, Ruiyu <ruiyu.ni@intel.com>;
> > Carsey, Jaben <jaben.carsey@intel.com>
> > Subject: [PATCH] ShellPkg ShellLib.h: Fix wrong parameter name for
> > ShellOpenFileByName
> >
> > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1221
> >
> > The parameter name FilePath should be FileName.
> >
> > I am trying to write an application for my own use and want to use
> > this interface, but confused by the parameter name.
> >
> > Interesting, the implementation in UefiShellLib.c is correct.
> >
> > Cc: Ruiyu Ni <ruiyu.ni@intel.com>
> > Cc: Jaben Carsey <jaben.carsey@intel.com>
> > Contributed-under: TianoCore Contribution Agreement 1.1
> > Signed-off-by: Star Zeng <star.zeng@intel.com>
> > ---
> > ShellPkg/Include/Library/ShellLib.h | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/ShellPkg/Include/Library/ShellLib.h
> > b/ShellPkg/Include/Library/ShellLib.h
> > index 92fddc50f5dd..d6a5319285dd 100644
> > --- a/ShellPkg/Include/Library/ShellLib.h
> > +++ b/ShellPkg/Include/Library/ShellLib.h
> > @@ -126,7 +126,7 @@ ShellOpenFileByDevicePath(
> > otherwise, the Filehandle is NULL. Attributes is valid only for
> > EFI_FILE_MODE_CREATE.
> >
> > - @param[in] FilePath The pointer to file name.
> > + @param[in] FileName The pointer to file name.
> > @param[out] FileHandle The pointer to the file handle.
> > @param[in] OpenMode The mode to open the file with.
> > @param[in] Attributes The file's file attributes.
> > @@ -151,7 +151,7 @@ ShellOpenFileByDevicePath( EFI_STATUS EFIAPI
> > ShellOpenFileByName(
> > - IN CONST CHAR16 *FilePath,
> > + IN CONST CHAR16 *FileName,
> > OUT SHELL_FILE_HANDLE *FileHandle,
> > IN UINT64 OpenMode,
> > IN UINT64 Attributes
> > --
> > 2.7.0.windows.1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-10-01 14:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-29 9:42 [PATCH] ShellPkg ShellLib.h: Fix wrong parameter name for ShellOpenFileByName Star Zeng
2018-09-30 1:11 ` Ni, Ruiyu
2018-09-30 1:20 ` Zeng, Star
2018-10-01 14:36 ` Carsey, Jaben
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox