[if gte mso 9]>

[edk2] Cannot access files with StdLib in my UEFI application

Subject: [edk2] Cannot access files with StdLib in my UEFI application

From: "Cohen Nehemia, Eli" <eli.cohen.nehemia@intel.com>

To: "edk2-devel@lists.sourceforge.net" <edk2-devel@lists.sourceforge.net>

Date: 2012-03-15 15:00:43

  • 2012-03-15 15:00:43  "Cohen Nehemia, Eli"   [edk2] Cannot access files with StdLib in my UEFI application

Hi,

 

I am developing an UEFI application using EADK and StdLib. That application runs just fine except when trying to access files.

 

When I try to access a file with fopen, whether for reading an existing one or creating a new one, I get a NULL in return. Apparently, this is not a permission issue because perror says "file not found" for when trying to read an existing file. I tried to use both relative and absolute paths, used both slash and backslash separators, used cwd function to get the current working directory (which is "fs0:\") but nothing works. Using access function to check for file existence on the application executable file itself yields a "file not found" error code. BTW – fopen does not work on the Nt32 emulation either (did not check the errno there, though).

 

Further details: Application compiled with most up to date EADK version, runs on an EFI Shell 2.31 [1.0] running mode 1.1.2, loaded from a USB stick mounted as fs0.

 

Thanks!

Eli.