public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* How to open a file by it's full path in UEFI
@ 2016-09-27  9:03 GN Keshava
  2016-09-27  9:07 ` Andrew Fish
  2016-09-27  9:16 ` Laszlo Ersek
  0 siblings, 2 replies; 15+ messages in thread
From: GN Keshava @ 2016-09-27  9:03 UTC (permalink / raw)
  To: edk2-devel@lists.01.org; +Cc: edk2-devel@lists.sourceforge.net

Hi all,


I'm trying to open a file from my UEFI application. The path of file is

fs1:/myfolder/myfile.txt

The code :

efiStatus = bs->LocateHandleBuffer(ByProtocol,
                                   &sfspGuid,
                                   NULL,
                                   &handleCount,
                                   &handles);

for (index = 0; index < (int)handleCount; ++ index)
{
    EFI_SIMPLE_FILE_SYSTEM_PROTOCOL* fs = NULL;

    efiStatus = bs->HandleProtocol(
        handles[index],
        &sfspGuid,
        (void**)&fs);

    EFI_FILE_PROTOCOL* root = NULL;
    ...
    efiStatus = fs->OpenVolume(fs, &root);

    EFI_FILE_PROTOCOL* token = NULL;

    efiStatus = root->Open(
        root,
        &token,
        L"myfolder\\myfile.txt",
        EFI_FILE_MODE_READ,
        EFI_FILE_READ_ONLY | EFI_FILE_HIDDEN | EFI_FILE_SYSTEM);
}

But using this method, I can only go through all the file system handles
and open each volume and try opening my file.

But I want to give full path to my file and open it in it's volume.

How can I acheive this?
Thanks.
With regards,
Keshava GN


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2016-09-29 10:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-27  9:03 How to open a file by it's full path in UEFI GN Keshava
2016-09-27  9:07 ` Andrew Fish
2016-09-27  9:28   ` GN Keshava
2016-09-27  9:16 ` Laszlo Ersek
2016-09-27  9:25   ` GN Keshava
2016-09-27  9:49     ` Laszlo Ersek
2016-09-27 10:46       ` GN Keshava
2016-09-27 11:17         ` Laszlo Ersek
2016-09-27 11:51           ` GN Keshava
2016-09-27 15:07             ` Carsey, Jaben
2016-09-27 15:13               ` Laszlo Ersek
2016-09-27 16:44             ` Jarlstrom, Laurie
2016-09-27 16:48               ` Andrew Fish
2016-09-27 16:56                 ` GN Keshava
2016-09-29 10:22               ` GN Keshava

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox