Hi,

i try to get the filesize of running .exe applications for a Taskmanager App.

When i execute:
User::LeaveIfError(fs.Entry(KFilePath, entry));
TInt fileSize = entry.iSize;

i get a "unable to execute file for security reasons" error.
I guess this error is because the exe is running. Or is it because the files is in /sys/bin/ ??

I have no AllFiles capability.


then i tried wiki example to get filesize with RFile

_LIT(KFileSpec,"C:\\Test.txt");
RFs fs;
User::LeaveIfError(fs.Connect());
CleanupClosePushL(fs);

RFile file;
TInt Err1=file.Open(fs,KFileSpec,EFileRead);
if(Err1==KErrNone)
{
TInt Size;
file.Size(Size);
HBufC8* buffer = HBufC8::NewLC(Size);
TPtr8 ptr= buffer->Des();
file.Read(ptr);
file.Close();
CleanupStack::PopAndDestroy(buffer);
}
fs.Close();
CleanupStack::PopAndDestroy(&fs); // destroy fs
I dont understand the example?
where can i define my TInt filesize = ... ??

would be nice if someone could help here.


Greets
Shizzl