Formated Output and file creation time

2017-08-16 Thread Vino.B via Digitalmars-d-learn
Hi, I have a small program which will list the file names, size and creation date and time, the output of the program is as below and required your help to print the output as per "Required Output" Current Output C:\Test1\Test2\T.txt 1234 2017-Aug-16 19:10:54.0618385

Folder Size

2017-08-19 Thread Vino.B via Digitalmars-d-learn
Hi All, I have written a small program to find the size of folder's , but the output is not as expected, hence request your help and advice on any techniques to reduce the run time of the program. Requirement: The script has to scan several file system

Re: Different Output after each execution

2017-08-19 Thread Vino.B via Digitalmars-d-learn
On Friday, 18 August 2017 at 16:53:46 UTC, Moritz Maxeiner wrote: On Friday, 18 August 2017 at 15:46:13 UTC, Vino.B wrote: [...] Negating the filtering rule should yield you the inverse set: --- dirEntries(i, SpanMode.shallow).filter!(a => a.isDir).filter!(a => !globMatch(a.baseName,

Long File path Exception:The system cannot find the path specified

2017-08-22 Thread Vino.B via Digitalmars-d-learn
Hi All, When i run the below code in windows i am getting "The system cannot find the path specified" even though the path exist , the length of the path is 516 as below, request your help. Path :

ore.exception.RangeError

2017-08-22 Thread Vino.B via Digitalmars-d-learn
Hi All, Can any one guide me what is wrong with the below code , whil i run the code without any arguments is am getting the below exception Execution : rdmd Summary.d - Not working rdmd Summary.d test - Working Program: void main (string[] args) { if(args.length != 2 )

Parameter File reading

2017-08-23 Thread Vino.B via Digitalmars-d-learn
Hi All, Can anyone provide me a example code on how to read a parameter file and use those parameter in the program. From, Vino.B

Re: Long File path Exception:The system cannot find the path specified

2017-08-23 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 23 August 2017 at 11:29:07 UTC, Moritz Maxeiner wrote: On Wednesday, 23 August 2017 at 05:06:50 UTC, Vino.B wrote: Hi All, When i run the below code in windows i am getting "The system cannot find the path specified" even though the path exist , the length of the path is 516

Re: ore.exception.RangeError

2017-08-23 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 23 August 2017 at 11:18:14 UTC, Moritz Maxeiner wrote: On Wednesday, 23 August 2017 at 05:53:46 UTC, ag0aep6g wrote: On 08/23/2017 07:45 AM, Vino.B wrote: Execution : rdmd Summary.d - Not working rdmd Summary.d test - Working Program: void main (string[] args) {

Re: Long File path Exception:The system cannot find the path specified

2017-08-23 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 23 August 2017 at 13:14:31 UTC, Moritz Maxeiner wrote: On Wednesday, 23 August 2017 at 13:04:28 UTC, Vino.B wrote: The line it complains is std.file.FileException@std\file.d(3713):even after enabling debug it points to the same Output: D:\DScript>rdmd -debug Test.d -r dryrun

Re: Long File path Exception:The system cannot find the path specified

2017-08-23 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 23 August 2017 at 12:12:47 UTC, Moritz Maxeiner wrote: On Wednesday, 23 August 2017 at 12:01:20 UTC, Vino.B wrote: On Wednesday, 23 August 2017 at 11:29:07 UTC, Moritz Maxeiner wrote: On which line do you get the Exception? Does it happen with shorter paths, as well? Assuming

Different Output after each execution

2017-08-18 Thread Vino.B via Digitalmars-d-learn
Hi All, I have written a small program to just list the directories, but when i run the program each time i am getting different output, hence request you help, below is the code Program: import std.file: dirEntries, isFile, SpanMode, remove; import std.stdio: writefln; import

Re: Formated Output and file creation time

2017-08-18 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 16 August 2017 at 17:03:51 UTC, H. S. Teoh wrote: On Wed, Aug 16, 2017 at 03:30:18PM +, Vino.B via Digitalmars-d-learn wrote: [...] [...] Try this: writefln("%-36s %8s %.20s", d, d.size, d.timeCreated()); T Hi Teoh, Thank you very much, it worked.

Re: Different Output after each execution

2017-08-18 Thread Vino.B via Digitalmars-d-learn
On Friday, 18 August 2017 at 11:24:24 UTC, Moritz Maxeiner wrote: On Friday, 18 August 2017 at 10:50:28 UTC, Moritz Maxeiner wrote: On Friday, 18 August 2017 at 10:06:04 UTC, Vino wrote: On Friday, 18 August 2017 at 08:34:39 UTC, ikod wrote: On Friday, 18 August 2017 at 08:00:26 UTC, Vino.B

Re: Assertion Error

2017-09-13 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 13 September 2017 at 11:03:38 UTC, Moritz Maxeiner wrote: On Wednesday, 13 September 2017 at 07:39:46 UTC, Vino.B wrote: On Tuesday, 12 September 2017 at 21:01:26 UTC, Moritz Maxeiner wrote: On Tuesday, 12 September 2017 at 19:44:19 UTC, vino wrote: Hi All, I have a small piece

Question on Container Array.

2017-09-18 Thread Vino.B via Digitalmars-d-learn
Hi All, Can some one explain me on the below question. Q1: void main (Array!string args) : Why can't we use container array in void main? Q2: What is the difference between the below? insert, insertBack stableInsert, stableInsertBack linearInsert, stableLinearInsert, stableLinearInsert

Using Parallel prints duplicates nor misses.

2017-09-17 Thread Vino.B via Digitalmars-d-learn
Hi, Request your help, the below code sometime prints duplicate and some time miss the entry. due to which any code written below the line "foreach (d; parallel(dFiles[], 1))" are some time duplicated and some time not executed(skips). tired adding sort and uniq to the writeln but no luck.

Array merge and sort

2017-09-20 Thread Vino.B via Digitalmars-d-learn
Hi All, My code output's the below so can any one help me on hot to merege all tese array and sort the same. Output : [ Tuple!(string, string)("C:\\Temp\\TEST1\\BACKUP\\DND1.pdf", "2017-Sep-06 16:06:42") ] [ Tuple!(string, string)("C:\\Temp\\TEST2\\EXPORT\\DND1.pdf", "2017-Sep-06

Re: Assertion Error

2017-09-19 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 13 September 2017 at 15:27:30 UTC, Moritz Maxeiner wrote: On Wednesday, 13 September 2017 at 15:12:57 UTC, Vino.B wrote: On Wednesday, 13 September 2017 at 11:03:38 UTC, Moritz Maxeiner wrote: On Wednesday, 13 September 2017 at 07:39:46 UTC, Vino.B wrote: [...] [...] ---

Re: Container Array

2017-09-08 Thread Vino.B via Digitalmars-d-learn
On Friday, 8 September 2017 at 09:51:38 UTC, Ali Çehreli wrote: On 09/07/2017 11:21 PM, Vino.B wrote: > At last was able to print the output, but i am getting some > "Deprecation" warnings like below and also can you help me in formating > the output to display ulong. > > Output: > Size.d(9):

Re: Container Array

2017-09-07 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 16:41:06 UTC, Vino.B wrote: HI All, Can some one provide me a example of how to use the std.container.array for the below code. import std.algorithm: filter, map; import std.file: SpanMode, dirEntries, isDir; import std.stdio: writeln; import std.typecons:

Re: Using closure causes GC allocation

2017-09-05 Thread Vino.B via Digitalmars-d-learn
On Monday, 4 September 2017 at 14:42:45 UTC, Azi Hassan wrote: On Monday, 4 September 2017 at 05:45:18 UTC, Vino.B wrote: In order to resolve the issue "Using closure causes GC allocation" it was stated that we need to use delegates Alternatively you can drop the functional style and use a

Re: Container Array

2017-09-08 Thread Vino.B via Digitalmars-d-learn
On Friday, 8 September 2017 at 12:14:46 UTC, Vino.B wrote: On Friday, 8 September 2017 at 09:51:38 UTC, Ali Çehreli wrote: On 09/07/2017 11:21 PM, Vino.B wrote: > At last was able to print the output, but i am getting some > "Deprecation" warnings like below and also can you help me in

Re: Deprecation: std.container.array.RangeT(A) is not visible from module Size

2017-09-08 Thread Vino.B via Digitalmars-d-learn
On Friday, 8 September 2017 at 14:48:38 UTC, Vino.B wrote: Hi All, The below code output's the below warning, so if std.container.array.RangeT(A) is deprecated then what is the equivalent for this, request your help on this. Warning : Size.d(10): Deprecation: std.container.array.RangeT(A)

Re: Container Array

2017-09-08 Thread Vino.B via Digitalmars-d-learn
On Friday, 8 September 2017 at 15:48:47 UTC, Vino.B wrote: On Friday, 8 September 2017 at 12:14:46 UTC, Vino.B wrote: On Friday, 8 September 2017 at 09:51:38 UTC, Ali Çehreli wrote: [...] Hi Ali, As stated earlier my release 1 code are still using std.array, so now in release 2 i am

Deprecation: std.container.array.RangeT(A) is not visible from module Size

2017-09-08 Thread Vino.B via Digitalmars-d-learn
Hi All, The below code output's the below warning, so if std.container.array.RangeT(A) is deprecated then what is the equivalent for this, request your help on this. Warning : Size.d(10): Deprecation: std.container.array.RangeT(A) is not visible from module Size Size.d(10): Deprecation:

Re: Deprecation: std.container.array.RangeT(A) is not visible from module Size

2017-09-08 Thread Vino.B via Digitalmars-d-learn
On Friday, 8 September 2017 at 15:47:39 UTC, Vino.B wrote: On Friday, 8 September 2017 at 14:48:38 UTC, Vino.B wrote: Hi All, The below code output's the below warning, so if std.container.array.RangeT(A) is deprecated then what is the equivalent for this, request your help on this.

Re: Deprecation: std.container.array.RangeT(A) is not visible from module Size

2017-09-08 Thread Vino.B via Digitalmars-d-learn
On Friday, 8 September 2017 at 16:58:35 UTC, Ali Çehreli wrote: On 09/08/2017 07:48 AM, Vino.B wrote: > if > std.container.array.RangeT(A) is deprecated No, it's not deprecated. It's a private symbol of the std.container.array module. You shouldn't be able to use it at all. The fact that you

Missing array element

2017-08-29 Thread Vino.B via Digitalmars-d-learn
Hi, Can any one help me on the below program, as I need the missing element for array "a" to be printed when compared with array "b" Program: import std.stdio, std.array, std.algorithm; string[] a = ["test1", "test2", "test4"]; string[] b = ["test2", "test4"]; void main () { auto m =

Re: Missing array element

2017-08-30 Thread Vino.B via Digitalmars-d-learn
On Tuesday, 29 August 2017 at 18:39:03 UTC, Ali Çehreli wrote: On 08/29/2017 11:20 AM, Vino.B wrote: string[] a = ["test1", "test2", "test4"]; string[] b = ["test2", "test4"]; Required output: "test1" You're looking for setDifference:

Re: Deprecation: std.container.array.RangeT(A) is not visible from module Size

2017-09-11 Thread Vino.B via Digitalmars-d-learn
On Sunday, 10 September 2017 at 23:10:20 UTC, Ali Çehreli wrote: On 09/10/2017 09:53 AM, Vino.B wrote: > auto coSizeDirList (string FFs, int SizeDir) { > //alias DirSizeList = typeof(coSizeDirList()); I worked with a version of coSizeDirList() that did not take any parameters. (Could be from

Re: Passing array as an function argument.

2017-09-11 Thread Vino.B via Digitalmars-d-learn
On Monday, 11 September 2017 at 12:03:32 UTC, wobbles wrote: On Monday, 11 September 2017 at 11:58:18 UTC, Vino.B wrote: Hi All, Can some one help me on how to pass a container array as a function argument , the below code throws an error, Error: Error: function T3.Test2 (Array!string t1)

Re: Passing array as an function argument.

2017-09-11 Thread Vino.B via Digitalmars-d-learn
On Monday, 11 September 2017 at 12:44:00 UTC, wobbles wrote: On Monday, 11 September 2017 at 12:20:08 UTC, Vino.B wrote: On Monday, 11 September 2017 at 12:03:32 UTC, wobbles wrote: On Monday, 11 September 2017 at 11:58:18 UTC, Vino.B wrote: [...] The type returned from Test1() is a

Passing array as an function argument.

2017-09-11 Thread Vino.B via Digitalmars-d-learn
Hi All, Can some one help me on how to pass a container array as a function argument , the below code throws an error, Error: Error: function T3.Test2 (Array!string t1) is not callable using argument types (RangeT!(Array!string)) import std.stdio: writeln; import std.container; auto

Re: Deprecation: std.container.array.RangeT(A) is not visible from module Size

2017-09-11 Thread Vino.B via Digitalmars-d-learn
On Monday, 11 September 2017 at 08:55:21 UTC, Vino.B wrote: On Sunday, 10 September 2017 at 23:10:20 UTC, Ali Çehreli wrote: On 09/10/2017 09:53 AM, Vino.B wrote: > auto coSizeDirList (string FFs, int SizeDir) { > //alias DirSizeList = typeof(coSizeDirList()); I worked with a version of

Re: Performance Issue

2017-09-06 Thread Vino.B via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 10:28:28 UTC, Stefan Koch wrote: On Tuesday, 5 September 2017 at 09:44:09 UTC, Vino.B wrote: Hi, The below code is consume more memory and slower can you provide your suggestion on how to over come these issues. [...] Much slower then ? Hi, This code

Re: Performance Issue

2017-09-06 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 14:38:39 UTC, Vino.B wrote: On Wednesday, 6 September 2017 at 10:58:25 UTC, Azi Hassan wrote: [...] Hi Azi, Your are correct, i tried to implement the fold in a separate small program as below, but not able to get the the required output, when you

Re: Container Array

2017-09-07 Thread Vino.B via Digitalmars-d-learn
On Thursday, 7 September 2017 at 14:26:08 UTC, Ali Çehreli wrote: On 09/07/2017 03:56 AM, Vino.B wrote: writeln(coCleanFiles); Access the elements by taking a slice of the container: writeln(coCleanFiles[]); Ali Hi Ali, Thank you very much, was ablee to resolve this issue and now

Re: Container Array

2017-09-07 Thread Vino.B via Digitalmars-d-learn
On Thursday, 7 September 2017 at 15:07:56 UTC, Vino.B wrote: On Thursday, 7 September 2017 at 14:26:08 UTC, Ali Çehreli wrote: On 09/07/2017 03:56 AM, Vino.B wrote: writeln(coCleanFiles); Access the elements by taking a slice of the container: writeln(coCleanFiles[]); Ali Hi Ali,

Re: Container Array

2017-09-07 Thread Vino.B via Digitalmars-d-learn
On Thursday, 7 September 2017 at 17:12:14 UTC, Vino.B wrote: On Thursday, 7 September 2017 at 15:07:56 UTC, Vino.B wrote: On Thursday, 7 September 2017 at 14:26:08 UTC, Ali Çehreli wrote: On 09/07/2017 03:56 AM, Vino.B wrote: writeln(coCleanFiles); Access the elements by taking a slice of

Array Printing

2017-09-12 Thread Vino.B via Digitalmars-d-learn
Hi All, Request your help in printing the below array output as per the below required output Array Output: ["C:\\Temp\\TEST2\\BACKUP\\dir1", "34", "C:\\Temp\\TEST2\\BACKUP\\dir2", "36", "C:\\Temp\\TEST3\\BACKUP\\dir1", "69"] ["C:\\Temp\\TEST2\\PROD_TEAM\\dir1", "34",

Re: Assertion Error

2017-09-13 Thread Vino.B via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 21:01:26 UTC, Moritz Maxeiner wrote: On Tuesday, 12 September 2017 at 19:44:19 UTC, vino wrote: Hi All, I have a small piece of code which executes perfectly 8 out of 10 times, very rarely it throws an assertion error, so is there a way to find which line of

Re: Deprecation: std.container.array.RangeT(A) is not visible from module Size

2017-09-10 Thread Vino.B via Digitalmars-d-learn
On Sunday, 10 September 2017 at 15:46:46 UTC, Ali Çehreli wrote: On 09/10/2017 04:54 AM, Vino.B wrote: > Thank you very much, as stated by you i used the auto function and now > i am get the output without any warnings That's because now you're taking advantage of D's type inference. Although

Re: Deprecation: std.container.array.RangeT(A) is not visible from module Size

2017-09-10 Thread Vino.B via Digitalmars-d-learn
On Friday, 8 September 2017 at 23:48:14 UTC, Ali Çehreli wrote: On 09/08/2017 11:21 AM, Vino.B wrote: > One final help on how to print the below > output , just in case if this issue is fixed in next release, > > Output: > [Tuple!string("C:\\Temp\\sapnas2\\BACKUP\\dir1"), >

Re: Container Array

2017-09-08 Thread Vino.B via Digitalmars-d-learn
On Thursday, 7 September 2017 at 20:47:43 UTC, Ali Çehreli wrote: On 09/07/2017 10:39 AM, Vino.B wrote: > Array!(Tuple!(string, ulong)) coSizeDirList () { You stated the return type explicitly above. > return tuple (dFiles[], Subdata[]); According to the error message, what is

Re: Array Printing

2017-09-12 Thread Vino.B via Digitalmars-d-learn
On Tuesday, 12 September 2017 at 07:28:00 UTC, Anton Fediushin wrote: On Tuesday, 12 September 2017 at 06:29:53 UTC, Vino.B wrote: Hi All, Request your help in printing the below array output as per the below required output Array Output: ["C:\\Temp\\TEST2\\BACKUP\\dir1", "34",

Container Array

2017-09-06 Thread Vino.B via Digitalmars-d-learn
HI All, Can some one provide me a example of how to use the std.container.array for the below code. import std.algorithm: filter, map; import std.file: SpanMode, dirEntries, isDir; import std.stdio: writeln; import std.typecons: tuple; import std.array: array; void main () { string[]

Re: Performance Issue

2017-09-06 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 10:58:25 UTC, Azi Hassan wrote: On Wednesday, 6 September 2017 at 08:10:35 UTC, Vino.B wrote: in the next line of the code i say to list only folders that are greater than 10 Mb but this now is listing all folder (folder whose size is less than 10 MB are

Re: Performance Issue

2017-09-07 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 18:44:26 UTC, Azi Hassan wrote: On Wednesday, 6 September 2017 at 18:21:44 UTC, Azi Hassan wrote: I tried to create a similar file structure on my Linux machine. Here's the result of ls -R TEST1: TEST1: BACKUP ... Upon further inspection it looks like I

Re: Long File path Exception:The system cannot find the path specified

2017-08-24 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 23 August 2017 at 13:50:18 UTC, Vino.B wrote: On Wednesday, 23 August 2017 at 13:14:31 UTC, Moritz Maxeiner wrote: [...] Hi, [...] Hi, Any idea of what is causing this issue.

Re: Folder Size

2017-08-21 Thread Vino.B via Digitalmars-d-learn
On Monday, 21 August 2017 at 08:57:52 UTC, Aravinda VK wrote: On Saturday, 19 August 2017 at 14:19:39 UTC, Vino.B wrote: [...] Keep a variable to add the sizes of subdirs auto dFiles = dirEntries(i, SpanMode.shallow).filter!(a => a.isDir && !globMatch(a.baseName, "*DND*")).array; ulong

SMTP Mail

2017-08-22 Thread Vino.B via Digitalmars-d-learn
Hi All, Request your help on sending Mails, I am able to receive mails with empty body the line "smtp.message ="Example Message" doesn't seem to be working and also please let me know how do i send a file as a attachment in a email. import std.net.curl; void main () { auto smtp =

2 Dimensional Array Sorting

2017-08-26 Thread Vino.B via Digitalmars-d-learn
Hi, Can someone provide me a example of sorting 2 Dimensional Array containing Filename and Size, and should be sorted by Size. From, Vino.B

Re: 2 Dimensional Array Sorting

2017-08-26 Thread Vino.B via Digitalmars-d-learn
On Saturday, 26 August 2017 at 10:07:53 UTC, user1234 wrote: On Saturday, 26 August 2017 at 09:53:44 UTC, Vino.B wrote: On Saturday, 26 August 2017 at 06:12:57 UTC, user1234 wrote: [...] Hi, I tired you logic, but doesn't seem to be working, as every time i execute the order of the file

Re: 2 Dimensional Array Sorting

2017-08-26 Thread Vino.B via Digitalmars-d-learn
On Saturday, 26 August 2017 at 10:45:13 UTC, Vino.B wrote: On Saturday, 26 August 2017 at 10:07:53 UTC, user1234 wrote: [...] Hi, Now there is no duplicate , but the sequence is still not correct [...] Hi, If I execute the script several time's i still get the duplicate entries.

Re: 2 Dimensional Array Sorting

2017-08-26 Thread Vino.B via Digitalmars-d-learn
On Saturday, 26 August 2017 at 06:12:57 UTC, user1234 wrote: On Saturday, 26 August 2017 at 06:11:37 UTC, user1234 wrote: On Saturday, 26 August 2017 at 06:01:15 UTC, Vino.B wrote: Hi, Can someone provide me a example of sorting 2 Dimensional Array containing Filename and Size, and should

Re: 2 Dimensional Array Sorting

2017-08-27 Thread Vino.B via Digitalmars-d-learn
On Saturday, 26 August 2017 at 10:53:03 UTC, Vino.B wrote: On Saturday, 26 August 2017 at 10:45:13 UTC, Vino.B wrote: On Saturday, 26 August 2017 at 10:07:53 UTC, user1234 wrote: [...] Hi, Now there is no duplicate , but the sequence is still not correct [...] Hi, If I execute the

Re: 2 Dimensional Array Sorting

2017-08-27 Thread Vino.B via Digitalmars-d-learn
On Sunday, 27 August 2017 at 11:53:29 UTC, Vino.B wrote: On Saturday, 26 August 2017 at 10:53:03 UTC, Vino.B wrote: [...] Hi, After analyzing a bit further was able to find that the out data before sorting is like below(4 - 2 dimensional array) hence the sorting is not working, so may i

Re: Appending data to array results in duplicate's.

2017-08-25 Thread Vino.B via Digitalmars-d-learn
On Friday, 25 August 2017 at 17:02:53 UTC, Jonathan M Davis wrote: On Friday, August 25, 2017 16:45:16 Vino.B via Digitalmars-d-learn wrote: Hi, Request your help on the below issue, Issue : While appending data to a array the data is getting duplicated. Program: import std.file

Re: Long File path Exception:The system cannot find the path specified

2017-08-25 Thread Vino.B via Digitalmars-d-learn
On Friday, 25 August 2017 at 09:08:44 UTC, zabruk70 wrote: On Thursday, 24 August 2017 at 18:02:24 UTC, vino wrote: Thanks for your support, was able to resolve this issue. Hello. IMHO, it will be better, if you will share your solution for other peoples :) Hi, Please find the solution

Appending data to array results in duplicate's.

2017-08-25 Thread Vino.B via Digitalmars-d-learn
Hi, Request your help on the below issue, Issue : While appending data to a array the data is getting duplicated. Program: import std.file: dirEntries, isFile, SpanMode; import std.stdio: writeln, writefln; import std.algorithm: filter, map; import std.array: array; import std.typecons:

Re: Multi dimensional array format priting

2017-08-25 Thread Vino.B via Digitalmars-d-learn
On Friday, 25 August 2017 at 17:41:31 UTC, Vino.B wrote: On Friday, 25 August 2017 at 17:02:53 UTC, Jonathan M Davis wrote: On Friday, August 25, 2017 16:45:16 Vino.B via Digitalmars-d-learn wrote: Hi, Request your help on the below issue, Issue : While appending data to a array the data

Help Required on Getopt

2017-09-01 Thread Vino.B via Digitalmars-d-learn
Hi All, When i run the below program without any arguments "D1.d -r" it is throwing error, but i need it to show the help menu Program: import std.stdio; import std.getopt; string r; void main (string[] args) { getopt(args, std.getopt.config.caseInsensitive,

Re: Valid File Path

2017-09-01 Thread Vino.B via Digitalmars-d-learn
On Thursday, 31 August 2017 at 23:45:01 UTC, Jonathan M Davis wrote: On Thursday, August 31, 2017 23:23:17 Vino via Digitalmars-d-learn wrote: [...] And why would that not be valid? isValidPath and isValidFilename are quite specific about what they think are valid path/file names, and

Re: Returning multiple values from a function

2017-09-04 Thread Vino.B via Digitalmars-d-learn
On Monday, 4 September 2017 at 07:40:23 UTC, crimaniak wrote: On Monday, 4 September 2017 at 07:27:12 UTC, Vino.B wrote: Hi, Can you help me in how to return multiple values from a function, the below code is throwing an error as below import std.stdio: writeln; import std.typecons: tuple,

Re: Using closure causes GC allocation

2017-09-03 Thread Vino.B via Digitalmars-d-learn
On Saturday, 2 September 2017 at 20:54:03 UTC, Vino.B wrote: On Saturday, 2 September 2017 at 20:10:58 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 18:59:30 UTC, Vino.B wrote: [...] Cannot reproduce under Linux with dmd 2.076.0 (with commented out Windows-only check). I'll

Returning multiple values from a function

2017-09-04 Thread Vino.B via Digitalmars-d-learn
Hi, Can you help me in how to return multiple values from a function, the below code is throwing an error as below Program: import std.stdio: writeln; import std.typecons: tuple, Tuple; Tuple!(int, string[]) Params () { int Test1; string[] Path; Test1 = 1; Path = ["C:\\Temp\\TEAM1\\BACKUP",

Re: Help Required on Getopt

2017-09-01 Thread Vino.B via Digitalmars-d-learn
On Friday, 1 September 2017 at 17:23:01 UTC, Jon Degenhardt wrote: On Friday, 1 September 2017 at 13:13:39 UTC, Vino.B wrote: Hi All, When i run the below program without any arguments "D1.d -r" it is throwing error, but i need it to show the help menu [snip...] Hi Vino, To get good

Using closure causes GC allocation

2017-09-02 Thread Vino.B via Digitalmars-d-learn
Hi All, Request your help on how to solve the issue in the below code as when i execute the program with -vgc it state as below: NewTD.d(21): vgc: using closure causes GC allocation NewTD.d(25): vgc: array literal may cause GC allocation void logClean (string[] Lglst, int LogAge) {

Help required on Array appender

2017-09-02 Thread Vino.B via Digitalmars-d-learn
Hi All, Can you please guide me how can i use array appender for the below piece of code string[][] cleanFiles (string FFs, string Step) { auto dFiles = dirEntries(FFs, SpanMode.shallow).filter!(a => a.isFile).map!(a => tuple(a.name , a.timeCreated)).array; foreach (d; dFiles) {

Re: Help required on Array appender

2017-09-02 Thread Vino.B via Digitalmars-d-learn
On Saturday, 2 September 2017 at 12:54:48 UTC, Nicholas Wilson wrote: On Saturday, 2 September 2017 at 10:15:04 UTC, Vino.B wrote: Hi All, Can you please guide me how can i use array appender for the below piece of code string[][] cleanFiles (string FFs, string Step) { auto dFiles =

Re: Using closure causes GC allocation

2017-09-02 Thread vino.b via Digitalmars-d-learn
On Saturday, 2 September 2017 at 18:02:06 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 17:43:08 UTC, Vino.B wrote: [...] Line 25 happens because of `[a.name]`. You request a new array: the memory for this has to be allocated (the reason why the compiler says "may" is because

Re: Using closure causes GC allocation

2017-09-02 Thread Vino.B via Digitalmars-d-learn
On Saturday, 2 September 2017 at 18:32:55 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 18:08:19 UTC, vino.b wrote: On Saturday, 2 September 2017 at 18:02:06 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 17:43:08 UTC, Vino.B wrote: [...] Line 25 happens because

Re: Using closure causes GC allocation

2017-09-02 Thread Vino.B via Digitalmars-d-learn
On Saturday, 2 September 2017 at 20:10:58 UTC, Moritz Maxeiner wrote: On Saturday, 2 September 2017 at 18:59:30 UTC, Vino.B wrote: [...] Cannot reproduce under Linux with dmd 2.076.0 (with commented out Windows-only check). I'll try to see what happens on Windows once I have a VM setup.

Re: Help required on Array appender

2017-09-02 Thread Vino.B via Digitalmars-d-learn
On Saturday, 2 September 2017 at 15:47:31 UTC, Vino.B wrote: On Saturday, 2 September 2017 at 12:54:48 UTC, Nicholas Wilson wrote: [...] Hi, [...] Hi, Was able to resolve the above issue, but again getting the same for other lines such as below when i tried to add the appender. auto

Re: Help required on Array appender

2017-09-02 Thread Vino.B via Digitalmars-d-learn
On Saturday, 2 September 2017 at 22:39:33 UTC, Nicholas Wilson wrote: On Saturday, 2 September 2017 at 21:11:17 UTC, Vino.B wrote: On Saturday, 2 September 2017 at 15:47:31 UTC, Vino.B wrote: On Saturday, 2 September 2017 at 12:54:48 UTC, Nicholas Wilson wrote: [...] Hi, [...] Hi, Was

Performance Issue

2017-09-05 Thread Vino.B via Digitalmars-d-learn
Hi, The below code is consume more memory and slower can you provide your suggestion on how to over come these issues. string[][] csizeDirList (string FFs, int SizeDir) { ulong subdirTotal = 0; ulong subdirTotalGB; auto Subdata = appender!(string[][]); auto dFiles

E-mail attachment with unwanted characters

2018-04-27 Thread Vino.B via Digitalmars-d-learn
Hi All, Request your help, the below code is working as expected, but when I receive the attachment, the attachment contains the orginal text plus some unwanted characters like below, can someone help me how to remove these unwanted characters. Unwanted characters This is a test

Re: E-mail attachment with unwanted characters

2018-04-28 Thread Vino.B via Digitalmars-d-learn
On Friday, 27 April 2018 at 18:20:46 UTC, Adam D. Ruppe wrote: On Friday, 27 April 2018 at 17:57:26 UTC, Vino.B wrote: headers.insert(to!string(Base64.encode(Content)) ~ ".\r\n"); headers.insert("--" ~ boundary ~ "."); what are those random dots for? Hi Adam, Thank you very much,

Re: Deleting a file with extsion *.FIFO in Windows

2018-05-31 Thread vino.B via Digitalmars-d-learn
On Thursday, 24 May 2018 at 11:31:15 UTC, bauss wrote: On Thursday, 24 May 2018 at 06:59:47 UTC, Vino wrote: Hi All, Request your help on how to delete a file which has the extension .fifo (.javast.fifo) in Windows. From, Vino.B What exactly is your issue with it? Hi Bauss, We have

Function Template for Dynamic Parameter

2018-07-01 Thread vino.B via Digitalmars-d-learn
All, Request your help, the D document states that "Template functions are useful for avoiding code duplication - instead of writing several copies of a function, each with a different parameter type, a single function template can be sufficient" which mean we can passing any type of

Re: Function Template for Dynamic Parameter

2018-07-01 Thread vino.B via Digitalmars-d-learn
On Sunday, 1 July 2018 at 09:55:34 UTC, Timoses wrote: On Sunday, 1 July 2018 at 09:46:32 UTC, vino.B wrote: All, Request your help, the D document states that "Template functions are useful for avoiding code duplication - instead of writing several copies of a function, each with a

Re: Function Template for Dynamic Parameter

2018-07-01 Thread vino.B via Digitalmars-d-learn
On Sunday, 1 July 2018 at 11:52:19 UTC, Alex wrote: On Sunday, 1 July 2018 at 11:19:50 UTC, vino.B wrote: Hi Timoses, Thank you very much, can you help me on how to rewrite the below using Variadic template Passing function as a parameter to another function: void ptFun(T)(T

Re: E-mail attachment with unwanted characters

2018-04-29 Thread Vino.B via Digitalmars-d-learn
On Saturday, 28 April 2018 at 16:37:26 UTC, Vino.B wrote: On Friday, 27 April 2018 at 18:20:46 UTC, Adam D. Ruppe wrote: [...] Hi Adam, Thank you very much, after removing the dot the unwanted characters disappeared, The earlier program (as function) is working as expected without any

setAttributes Issue.

2018-07-15 Thread vino.B via Digitalmars-d-learn
Hi All, Request your help, can some one find what is the issue with the below code, as this is throwing the error "Access is denied". as the below code is supposed to to remove the read-only permission if set. Code: import std.algorithm; import std.array; import std.container.array;

Re: Check whether a range is empty

2018-07-15 Thread vino.B via Digitalmars-d-learn
On Saturday, 14 July 2018 at 17:20:52 UTC, Ali Çehreli wrote: First, please show us code that demonstrates the issue. On 07/14/2018 07:47 AM, vino.B wrote: >The reason it never prints the text "Empty" is that the out of the > "r" is just an empty array. > > OUTPUT: > [] > [] If that's the

rmdirRecurse equivalent Windows API

2018-07-15 Thread vino.B via Digitalmars-d-learn
Hi All, The D function rmdirRecurse on windows works 80% and rest of the time it complains the the "The filename, directory name, or volume label syntax is incorrect." while accessing the file using UNC path, so is there any alternate such as Windows API to remove folder irrespective of

Re: setAttributes Issue.

2018-07-15 Thread vino.B via Digitalmars-d-learn
On Sunday, 15 July 2018 at 10:07:49 UTC, vino.B wrote: Hi All, Request your help, can some one find what is the issue with the below code, as this is throwing the error "Access is denied". as the below code is supposed to to remove the read-only permission if set. [...] Hi All, Was

Re: Check whether a range is empty

2018-07-15 Thread vino.B via Digitalmars-d-learn
On Sunday, 15 July 2018 at 12:18:27 UTC, Steven Schveighoffer wrote: On 7/15/18 7:45 AM, vino.B wrote: [...] I still don't know why you are using chain here as it equates to the identity function in this instance:

Re: Check whether a range is empty

2018-07-14 Thread vino.B via Digitalmars-d-learn
On Friday, 13 July 2018 at 19:45:03 UTC, Steven Schveighoffer wrote: On 7/13/18 3:29 PM, vino.B wrote: [...] Well, empty is how you detect whether any range is empty, and as far as ranges are concerned, your code is correctly checking for empty. A couple comments: 1. Why are you using

Re: Check whether a range is empty

2018-07-14 Thread vino.B via Digitalmars-d-learn
On Saturday, 14 July 2018 at 14:28:52 UTC, vino.B wrote: On Friday, 13 July 2018 at 19:45:03 UTC, Steven Schveighoffer wrote: On 7/13/18 3:29 PM, vino.B wrote: [...] Well, empty is how you detect whether any range is empty, and as far as ranges are concerned, your code is correctly

Re: Function Template for Dynamic Parameter

2018-07-05 Thread vino.B via Digitalmars-d-learn
On Sunday, 1 July 2018 at 12:46:30 UTC, Timoses wrote: On Sunday, 1 July 2018 at 11:58:30 UTC, vino.B wrote: On Sunday, 1 July 2018 at 11:52:19 UTC, Alex wrote: NewType.d(19): Error: function declaration without return type. (Note that constructors are always named this) [...] auto

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-10 Thread vino.B via Digitalmars-d-learn
On Monday, 9 July 2018 at 18:07:49 UTC, Alex wrote: On Monday, 9 July 2018 at 17:26:30 UTC, vino.B wrote: Request Help: void process(alias coRoutine, T...)(Array!string Dirlst, T params) { ReturnType!coRoutine rData; / This line is not working alias scRType =

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-10 Thread vino.B via Digitalmars-d-learn
On Tuesday, 10 July 2018 at 14:50:53 UTC, Alex wrote: On Tuesday, 10 July 2018 at 14:38:03 UTC, vino.B wrote: Hi Alex, The reason the I am storing the output of "PFresult.toRange" to another array "rData" is that the output of the PFresult.toRange is different each time we execute the

Outside array bounds

2018-07-07 Thread vino.B via Digitalmars-d-learn
Hi All, Request you help, on the below code import std.stdio: writeln; void process(T ...)(string ID, T args) { if (ID == "I1") { writeln(args.length, "\t", args[0]); } else if (ID == "I2") { writeln(args.length, "\t", args[1]);} } void main() { string S1 = "Test1", S2 = "Test2", ID1 =

Re: Outside array bounds

2018-07-07 Thread vino.B via Digitalmars-d-learn
On Saturday, 7 July 2018 at 12:13:21 UTC, Alex wrote: On Saturday, 7 July 2018 at 11:22:38 UTC, Timoses wrote: Aw, got it. So args is actually a tuple type where accessing beyond the defined tuple (T) is invalid? auto a = [1, 2, 4]; // works pragma(msg, typeof(a[3]));

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-08 Thread vino.B via Digitalmars-d-learn
On Sunday, 8 July 2018 at 19:22:32 UTC, Timoses wrote: On Sunday, 8 July 2018 at 18:46:31 UTC, vino.B wrote: Hi All, Request you help, in the below code we pass the function "Testfun" as a parameter to another function "process" in order for the function "process" to work we have to specify

Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-08 Thread vino.B via Digitalmars-d-learn
Hi All, Request you help, in the below code we pass the function "Testfun" as a parameter to another function "process" in order for the function "process" to work we have to specify the type of the parameter that is passed to the function "(T function(string, int) coRoutine, string Test,

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-09 Thread vino.B via Digitalmars-d-learn
On Sunday, 8 July 2018 at 19:10:24 UTC, Alex wrote: On Sunday, 8 July 2018 at 18:46:31 UTC, vino.B wrote: Request you help, in the below code we pass the function "Testfun" as a parameter to another function "process" in order for the function "process" to work we have to specify the type of

Re: Passing function(whose parameter would be dynamic and the type is unknown) as a parameter to another function.

2018-07-09 Thread vino.B via Digitalmars-d-learn
On Monday, 9 July 2018 at 15:49:50 UTC, Alex wrote: On Monday, 9 July 2018 at 15:40:53 UTC, vino.B wrote: On Sunday, 8 July 2018 at 19:10:24 UTC, Alex wrote: On Sunday, 8 July 2018 at 18:46:31 UTC, vino.B wrote: Request you help, in the below code we pass the function "Testfun" as a

Check whether a range is empty

2018-07-13 Thread vino.B via Digitalmars-d-learn
Hi All, How do i check whether a range is empty. eg. (!PFResutl.toRange).empty. I tired the below, but it is no printing Empty if the range is empty it just prints blank line. if (!(!PFResutl.toRange).empty) { writeln("Empty"); } From, Vino.B

  1   2   >