2008-3-19 18:39
yunxing520
怎么我写进去的是路径尔不是文本内容?
小弟愚昧·
_LIT( KFileName, "C:\\private\\E4F660A4\\test.txt" );
_LIT( KText, "c:\\data\\others\\txtt.txt");
。。。。。。。。。。。。。
RFile file;
err = file.Replace(fsSession, KFileName, EFileWrite );
CleanupClosePushL( file );
if ( KErrNone != err )
{
CleanupStack:: PopAndDestroy(2); // file, fsSession
return;
}
TParse fileSpec;
fileSpec. Set (KText, NULL, NULL);
TBuf <16> text(KText);
RFileWriteStream outputFileStream( file );
CleanupClosePushL( outputFileStream );
outputFileStream << text ;
CleanupStack:: PopAndDestroy(3); // outputFileStream, file, fsSession
}
[[i] 本帖最后由 蓝色的忧郁 于 2008-3-20 08:47 编辑 [/i]]
2008-3-19 18:40
yunxing520
我晕·
我再在模拟器里运行 显示:
程序已关闭
user11
2008-3-20 08:44
蓝色的忧郁
你可以查一下SDK, 报USER 11错的原因
USER 11
This panic is raised when any operation that moves or copies data to a 16-bit variant descriptor, causes the length of that descriptor to exceed its maximum length.
It may be caused by any of the copying, appending or formatting member functions and, specifically, by the Insert(), Replace(), Fill(), Fillz() and ZeroTerminate() descriptor member functions. It can also be caused by the SetLength() function. See TDes16.
2008-3-20 09:35
蓝色的忧郁
首先,你想做什么?把文件的内容写到文件里? 按照你的代码,是把KText的内容写到C:\private\E4F660A4\test.txt个文件里.而KText的内容是c:\data\others\txtt.txt
2008-3-20 15:04
yunxing520
我想要的是通过路径名吧TXTT.TXT里的内容写到TEST.TXT里 而不是吧路径名写进去!
那该怎么做???
页:
[1]
Powered by Discuz! Archiver 5.5.0
© 2001-2006 Comsenz Inc.