×
Namespaces

Variants
Actions

如何不用RFile读取文件大小

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata

文章
翻译:
hoolee
最后由 hamishwillee 在 22 Dec 2011 编辑

详细说明

TEntry类封装了文件/目录的相关信息。RFs的Entry()方法通过TEntry可以提供任何文件系统的相关信息。使用的示例代码如下:

_LIT(KFileName, "c:\\system\\apps\\abc.txt");
RFs fs;
TInt err = fs.Connect();
User::LeaveIfError(err);
CleanupClosePushL(fs);
TEntry entry; // auto variable
err = fs.Entry(KFileName, entry); // used as OUT parameter
User::LeaveIfError(err);
TInt size = entry.iSize; // the file size
CleanupStack::PopAndDestroy(&fs);
This page was last modified on 22 December 2011, at 05:03.
86 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×