Re: Record separator is being lost after string cast

2015-02-04 Thread Kadir Erdem Demir via Digitalmars-d-learn
Thanks a lot, I will follow your advise and implement this part same as your example. Regards Kadir Erdem

Re: Record separator is being lost after string cast

2015-02-04 Thread ketmar via Digitalmars-d-learn
On Wed, 04 Feb 2015 09:28:27 +, Kadir Erdem Demir wrote: > I am sorry make a busy community more busy with false alarms. don't mind it. ;-) "D.learn" is for *any* questions about language, no matter how strange they may seem. > How can I write the code below better? How can I reduce the num

Re: Record separator is being lost after string cast

2015-02-04 Thread Kadir Erdem Demir via Digitalmars-d-learn
don't beleive what you see! ;-) I am sorry make a busy community more busy with false alarms. When I write to file I saw Record Separator really exists. I hope my second question is a valid one. How can I write the code below better? How can I reduce the number of foreach? statements. Fi

Re: Record separator is being lost after string cast

2015-02-04 Thread ketmar via Digitalmars-d-learn
On Wed, 04 Feb 2015 08:13:28 +, Kadir Erdem Demir wrote: > A more general and understandable code for first question : > > ubyte[] temp = [ 65, 30, 66, 30, 67]; writeln(temp); > string tempStr = cast(string) temp; > writeln (tempStr); > > Result is : ABC which is not desired.

Re: Record separator is being lost after string cast

2015-02-04 Thread Kagamin via Digitalmars-d-learn
You can use C functions in D too: import core.stdc.stdio; ubyte[] temp = [ 65, 30, 66, 30, 67, 0]; puts(cast(char*)temp.ptr);

Re: Record separator is being lost after string cast

2015-02-04 Thread Kagamin via Digitalmars-d-learn
Looks like RS is an unprintable character, that's why you don't see it in console.

Record separator is being lost after string cast

2015-02-04 Thread Kadir Erdem Demir via Digitalmars-d-learn
I am opening a .gz file and reading it chunk by chunk for uncompressing it. The data in the uncompressed file is like : aRSbRScRSd, There are record separators(ASCII code 30) between each record(records in my dummy example a,b,c). File file = File(mylog.gz, "r"); auto uc = new UnComp