×
Namespaces

Variants
Actions
(Difference between revisions)

How to use RFileWriteStream

From Nokia Developer Wiki
Jump to: navigation, search
lpvalente (Talk | contribs)
lpvalente (Talk | contribs)
m (formatted)
Line 1: Line 1:
[[Image:More_work_needed.gif]]
+
This article shows how to use RFileWriteStream to write a stream to a file.
  
Following article shows how to use RFileWriteStream to write stream to a file.
+
'''Headers required:'''
 
+
'''Headers Require:'''
+
 
<code cpp>
 
<code cpp>
 
#include <s32file.h> //RFileWriteStream  
 
#include <s32file.h> //RFileWriteStream  
Line 19: Line 17:
 
TInt16 someInt;
 
TInt16 someInt;
 
RFileWriteStream writerStream;
 
RFileWriteStream writerStream;
writerStream.PushL(); // writerStream on cleanup stack
+
 
User::LeaveIfError(writerStream.Create(fs, fileName, EFileWrite)); //fs is ur file session and fileName is name of ur file.
+
// writerStream on cleanup stack
 +
writerStream.PushL();  
 +
 
 +
//fs is ur file session and fileName is name of ur file.
 +
User::LeaveIfError(writerStream.Create(fs, fileName, EFileWrite));
 +
 
 
writerStream.WriteInt16L(someInt);
 
writerStream.WriteInt16L(someInt);
 
writerStream.CommitL();
 
writerStream.CommitL();
writerStream.Pop(); // writerStream
+
 
 +
// free writerStream
 +
writerStream.Pop();  
 
writerStream.Release();
 
writerStream.Release();
 +
 
</code>
 
</code>
  
Line 31: Line 37:
  
 
[[Category:Symbian C++]]
 
[[Category:Symbian C++]]
 +
[[Category:Code Examples]]

Revision as of 15:54, 2 April 2009

This article shows how to use RFileWriteStream to write a stream to a file.

Headers required:

#include <s32file.h> //RFileWriteStream 
#include <f32file.h> //RFs

Library needed:

LIBRARY  estor.lib //RFileWriteStream 
LIBRARY efsrv.lib //RFs

Source:

TInt16 someInt;
RFileWriteStream writerStream;
 
// writerStream on cleanup stack
writerStream.PushL();
 
//fs is ur file session and fileName is name of ur file.
User::LeaveIfError(writerStream.Create(fs, fileName, EFileWrite));
 
writerStream.WriteInt16L(someInt);
writerStream.CommitL();
 
// free writerStream
writerStream.Pop();
writerStream.Release();

Related Links:

53 page views in the last 30 days.
×