[U-Boot] fopen/fwrite functions

Wolfgang Denk wd at denx.de
Thu May 30 14:55:16 CEST 2013


Dear TigerLiu at viatech.com.cn,

please do not top post / full quote.  See [1] if you need help.

[1] http://www.netmeister.org/news/learn2quote.html


In message <FE7ADED5C2218B4786C09CD97DC4C49F8DB429 at exchbj02.viatech.com.bj> you wrote:
>
> U-boot supports FAT file system.

Yes, it does.  And it supports commands to access these.

> So, i want to read/write a file in USB disk (formatted with fat file
> system).
> So, could i use fopen/fwrite functions?

No, you cannot.

As I mentioned before: We do not even have a concept of files in
U-Boot.  Operations like fopen/fwrite make only sense when you always
have an underlying file system (like the root file system in Unix
systems).  We don't have that, and so we have no functions like
fopen() or open() etc.

To read a file from a FAT file system, you have to use the file system
specific access code, in this case do_fat_fsload() resp. do_load()

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
When properly administered, vacations do not  diminish  productivity:
for every week you're away and get nothing done, there's another when
your boss is away and you get twice as much done.  -- Daniel B. Luten


More information about the U-Boot mailing list