Re: [U-Boot] fopen/fwrite functions

2013-05-30 Thread Wolfgang Denk
Dear tiger...@viatech.com.cn,

In message fe7aded5c2218b4786c09cd97dc4c49f8db...@exchbj02.viatech.com.bj you 
wrote:

 Could i use fopen/fwrite standard C lib functions in U-boot code?

What for?  We do not even have a concept of files in U-Boot...

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: w...@denx.de
Any time things appear to be going better, you have overlooked  some-
thing.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] fopen/fwrite functions

2013-05-30 Thread TigerLiu
Dear Denk:
U-boot supports FAT file system.
So, i want to read/write a file in USB disk (formatted with fat file system).
So, could i use fopen/fwrite functions?

Best wishes,

-邮件原件-
发件人: Wolfgang Denk [mailto:w...@denx.de] 
发送时间: 2013年5月30日 15:50
收件人: Tiger Liu
抄送: u-boot@lists.denx.de
主题: Re: [U-Boot] fopen/fwrite functions

Dear tiger...@viatech.com.cn,

In message fe7aded5c2218b4786c09cd97dc4c49f8db...@exchbj02.viatech.com.bj you 
wrote:

 Could i use fopen/fwrite standard C lib functions in U-boot code?

What for?  We do not even have a concept of files in U-Boot...

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: w...@denx.de
Any time things appear to be going better, you have overlooked  some-
thing.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] fopen/fwrite functions

2013-05-30 Thread Wolfgang Denk
Dear tiger...@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 fe7aded5c2218b4786c09cd97dc4c49f8db...@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: w...@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
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] fopen/fwrite functions

2013-05-30 Thread TigerLiu
Dear Denk:
Got it!
Thank you!

Best wishes,
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] fopen/fwrite functions

2013-05-29 Thread TigerLiu
Hi, experts:
Could i use fopen/fwrite standard C lib functions in U-boot code?

Best wishes,
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot