digitalmars.D.learn - Strange behaviour with mmfile
- bioinfornatics (43/43) Jan 28 2013 Dear,
- bioinfornatics (9/9) Jan 28 2013 I missed to show the code
- nazriel (7/16) Jan 28 2013 MmFile m = new MmFile( args[0] ); ?
- H. S. Teoh (8/23) Jan 28 2013 [...]
- bioinfornatics (3/26) Jan 29 2013 Oh yes stupid error thanks
Dear, Why when i try to read this file: ------------Input file------------------------- $ cat little.fastq=20 H8:C16L5ACXX:8:1101:1168:2103/1 TCTGAAGGCATGCTGCAATTGTGAATGGCAGAAATGT + ? DD>DBDAFDF 4CFGICFHHECHEEBF;E FFFG H8:C16L5ACXX:8:1101:1223:2104/1 CTCACTTTTGTACTTTAGACAAGCGCTTTTAGTAGTGCT + ;DD;?DHFFHFG9FAFCEGFGBFE1EFFGFGGHG9D* H8:C16L5ACXX:8:1101:1166:2142/1 ATCTGGGAAGACGCCGCCGGGTTCAAATCACCTTGGTCGGCATCGTCGATCCGC + ;=3D?DDDDD3C??) :E1CDD)?B?B<99BB8=3D<8)8.=3DA88<8)56;9/>2=3D?? By using mmfile ubyte given do not corresponding to the letter. By example for i expect 64 but i got 127 ---------------Result----------------------- $ ./test_mmap little2.fastq 127 =7F 69 E 76 L 70 F 2 =02 1 =01 1 =01 0=20 0=20 0=20 0=20 0=20 0=20 0=20 0=20 0=20 2 =02 0=20 62 > 0=20 =E2=80=A6 and that continue Big thanks Note i have try with both ldc and gdc
Jan 28 2013
I missed to show the code $ cat test_mmap.d import std.stdio; import std.mmfile; void main(string[] args ){ MmFile m =3D new MmFile( args[0] ); foreach( ulong c; 0..m.length ) writeln( m[c], " ", cast(dchar) m[c] ); }
Jan 28 2013
On Tuesday, 29 January 2013 at 00:49:07 UTC, bioinfornatics wrote:I missed to show the code $ cat test_mmap.d import std.stdio; import std.mmfile; void main(string[] args ){ MmFile m = new MmFile( args[0] ); foreach( ulong c; 0..m.length ) writeln( m[c], " ", cast(dchar) m[c] ); }MmFile m = new MmFile( args[0] ); ? Didn't you mean args[1] or something? Because now you are reading your binary file and output is correct, its spits out elf header info. My guess is your are passing file with DNA (or whatever it is) via command line arguments
Jan 28 2013
On Tue, Jan 29, 2013 at 05:46:49AM +0100, nazriel wrote:On Tuesday, 29 January 2013 at 00:49:07 UTC, bioinfornatics wrote:[...] Good catch! I looked at the OP's code and didn't notice that. :) In D, args[0] is the name of the program, and args[1] is the first argument, etc.. T -- Nearly all men can stand adversity, but if you want to test a man's character, give him power. -- Abraham LincolnI missed to show the code $ cat test_mmap.d import std.stdio; import std.mmfile; void main(string[] args ){ MmFile m = new MmFile( args[0] ); foreach( ulong c; 0..m.length ) writeln( m[c], " ", cast(dchar) m[c] ); }MmFile m = new MmFile( args[0] ); ? Didn't you mean args[1] or something?
Jan 28 2013
On Tuesday, 29 January 2013 at 06:37:11 UTC, H. S. Teoh wrote:On Tue, Jan 29, 2013 at 05:46:49AM +0100, nazriel wrote:Oh yes stupid error thanks LOLOn Tuesday, 29 January 2013 at 00:49:07 UTC, bioinfornatics wrote:[...] Good catch! I looked at the OP's code and didn't notice that. :) In D, args[0] is the name of the program, and args[1] is the first argument, etc.. TI missed to show the code $ cat test_mmap.d import std.stdio; import std.mmfile; void main(string[] args ){ MmFile m = new MmFile( args[0] ); foreach( ulong c; 0..m.length ) writeln( m[c], " ", cast(dchar) m[c] ); }MmFile m = new MmFile( args[0] ); ? Didn't you mean args[1] or something?
Jan 29 2013