digitalmars.D.learn - temp file
- bioinfornatics (4/5) Feb 17 2012 I use dmdfe 2.058, i do just:
- Denis Shelomovskij (14/19) Feb 18 2012 Full source, please. And you should use `File.tmpfile()` instead of
- bioinfornatics (22/47) Feb 18 2012 thanks is was mine stupid error.
- HeiHon (9/20) Feb 18 2012 ...
hi, when i try to use tmpfile from std.stdio i get this errorchar 0x00ad not allowed in identifierI use dmdfe 2.058, i do just: File tmp =3D tmpfile();
Feb 17 2012
18.02.2012 6:59, bioinfornatics пишет:hi, when i try to use tmpfile from std.stdio i get this errorFull source, please. And you should use `File.tmpfile()` instead of `tmpfile()` (unless you are already in `with(File)`?). This compiles: --- import std.stdio; void main() { with(File) File tmp = tmpfile(); } --- Anyway, 0x00ad is 'SOFT HYPHEN' (not a '_' char) and is valid but ignorable in a Java identifier. Looks like your editor added it. http://www.fileformat.info/info/unicode/char/ad/index.htm By the way, you just inspired me to fill this: http://d.puremagic.com/issues/show_bug.cgi?id=7537char 0x00ad not allowed in identifierI use dmdfe 2.058, i do just: File tmp = tmpfile();
Feb 18 2012
Le samedi 18 f=C3=A9vrier 2012 =C3=A0 12:58 +0400, Denis Shelomovskij a =C3= =A9crit :18.02.2012 6:59, bioinfornatics =D0=BF=D0=B8=D1=88=D0=B5=D1=82:thanks is was mine stupid error. Then now i have this: -------------------------- cat tmp.d import std.string; import std.stdio; void main( ){ File tmp =3D File.tmpfile(); tmp.writeln( "ok" ); tmp.writeln( "D is Fun" ); writefln( "fileName: %s", tmp.name ); foreach( line; tmp.byLine() ) writefln( "l: %s", line ); } -------------------------- $ ./tmp fileName:=20 -------------------------- Why i do not get the file name ? why i can not iterate over line?hi, when i try to use tmpfile from std.stdio i get this error=20 Full source, please. And you should use `File.tmpfile()` instead of=20 `tmpfile()` (unless you are already in `with(File)`?). This compiles: --- import std.stdio; =20 void main() { with(File) File tmp =3D tmpfile(); } --- =20 Anyway, 0x00ad is 'SOFT HYPHEN' (not a '_' char) and is valid but=20 ignorable in a Java identifier. Looks like your editor added it. http://www.fileformat.info/info/unicode/char/ad/index.htm =20 By the way, you just inspired me to fill this: http://d.puremagic.com/issues/show_bug.cgi?id=3D7537char 0x00ad not allowed in identifierI use dmdfe 2.058, i do just: File tmp =3D tmpfile();
Feb 18 2012
On Saturday, 18 February 2012 at 10:19:06 UTC, bioinfornatics wrote:import std.string; import std.stdio; void main( ){ File tmp = File.tmpfile(); tmp.writeln( "ok" ); tmp.writeln( "D is Fun" ); writefln( "fileName: %s", tmp.name ); foreach( line; tmp.byLine() ) writefln( "l: %s", line ); }...why i can not iterate over line?You can, but the file is still open and you are at the end of the file. Try: tmp.rewind; foreach( line; tmp.byLine() ) writefln( "l: %s", line );
Feb 18 2012