×
Namespaces

Variants
Actions
(Difference between revisions)

How to use RFileWriteStream

From Nokia Developer Wiki
Jump to: navigation, search
lpvalente (Talk | contribs)
hamishwillee (Talk | contribs)
m (Hamishwillee - Fix categories)
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Image:More_work_needed.gif]]
+
[[Category:Symbian C++]][[Category:Code Snippet]][[Category:Files/Data]]
 +
{{ArticleMetaData <!-- v1.2 -->
 +
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Qt SDK 1.1.4]) -->
 +
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 +
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20090307
 +
|author= [[User:Savaj]]
 +
}}
 +
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 11: Line 32:
 
'''Library needed:'''
 
'''Library needed:'''
 
<code cpp>
 
<code cpp>
LIBRARY estor.lib //RFileWriteStream  
+
LIBRARY estor.lib //RFileWriteStream  
LIBRARY efsrv.lib //RFs
+
LIBRARY efsrv.lib //RFs
 
</code>
 
</code>
  
Line 19: Line 40:
 
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 30: Line 59:
 
* [[How to use RFileReadStream]]
 
* [[How to use RFileReadStream]]
  
[[Category:Symbian C++]]
+
{{VersionHint}}
 +
[[Category:Symbian]]
 +
[[Category:S60 1st Edition]] [[Category:S60 2nd Edition (initial release)]] [[Category:S60 2nd Edition FP1]] [[Category:S60 2nd Edition FP2]] [[Category:S60 2nd Edition FP3]]
 +
[[Category:S60 3rd Edition (initial release)]] [[Category:S60 3rd Edition FP1]] [[Category:S60 3rd Edition FP2]]
 +
[[Category:S60 5th Edition]]
 +
[[Category:Symbian^3]] [[Category:Symbian Anna]] [[Category:Nokia Belle]]

Revision as of 02:50, 4 December 2012

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:

Version Hint

Windows Phone: [[Category:Windows Phone]]
[[Category:Windows Phone 7.5]]
[[Category:Windows Phone 8]]

Nokia Asha: [[Category:Nokia Asha]]
[[Category:Nokia Asha Platform 1.0]]

Series 40: [[Category:Series 40]]
[[Category:Series 40 1st Edition]] [[Category:Series 40 2nd Edition]]
[[Category:Series 40 3rd Edition (initial release)]] [[Category:Series 40 3rd Edition FP1]] [[Category:Series 40 3rd Edition FP2]]
[[Category:Series 40 5th Edition (initial release)]] [[Category:Series 40 5th Edition FP1]]
[[Category:Series 40 6th Edition (initial release)]] [[Category:Series 40 6th Edition FP1]] [[Category:Series 40 Developer Platform 1.0]] [[Category:Series 40 Developer Platform 1.1]] [[Category:Series 40 Developer Platform 2.0]]

Symbian: [[Category:Symbian]]
[[Category:S60 1st Edition]] [[Category:S60 2nd Edition (initial release)]] [[Category:S60 2nd Edition FP1]] [[Category:S60 2nd Edition FP2]] [[Category:S60 2nd Edition FP3]]
[[Category:S60 3rd Edition (initial release)]] [[Category:S60 3rd Edition FP1]] [[Category:S60 3rd Edition FP2]]
[[Category:S60 5th Edition]]
[[Category:Symbian^3]] [[Category:Symbian Anna]] [[Category:Nokia Belle]]

50 page views in the last 30 days.
×