Re: Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-07 Thread Jesse Phillips via Digitalmars-d-learn
On Monday, 7 May 2018 at 14:31:23 UTC, Jesse Phillips wrote: I wouldn't use time created. It can be newer than last modified this wholey inacurate. Last accessed could be a much more appopriate choice if trying to determine what is important. Sorry, to answer your actual question, I do

Re: Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-07 Thread Jesse Phillips via Digitalmars-d-learn
On Friday, 4 May 2018 at 11:49:24 UTC, Vino wrote: Hi All, Request your help, I have a D program written on Windows platform and the program is working as expected, now i am trying to port the same program to Linux, my program use the function "timeCreated" from std.file for Windows hugely

Re: Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-07 Thread wjoe via Digitalmars-d-learn
On Friday, 4 May 2018 at 15:42:56 UTC, wjoe wrote: I think that's not possible. You can't query information that hasn't been stored. I stand corrected. As Russel Winder points out there are file systems that store this information and since Linux 4.11 you can query it via statx(2).

Re: Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-05 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2018-05-04 at 08:02 -0600, Jonathan M Davis via Digitalmars-d-learn wrote: > […] > Linux does not keep track of the creation time of a file. So, it will not > work to have a program on Linux ask a file how long it's been since the file > was created. If you want that information, you'll

Re: Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-04 Thread Kagamin via Digitalmars-d-learn
If you just want to clean logs, then use modification time on all oses: auto clogClean (string LogDir ) { Array!(Tuple!(string, SysTime)) dFiles; dFiles.insert(dirEntries(LogDir, SpanMode.shallow).filter!(a => a.isFile).map!(a => tuple(a.name, a.timeLastModified))); return dFiles; }

Re: Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-04 Thread wjoe via Digitalmars-d-learn
On Friday, 4 May 2018 at 15:30:26 UTC, Vino wrote: On Friday, 4 May 2018 at 15:16:23 UTC, wjoe wrote: [...] Hi Wjoe, Thank you very much, but what i am expecting is something like OS switch, based of OS type switch the funciton eg: If OS is windows use the funciton timeCreated else if

Re: Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-04 Thread Vino via Digitalmars-d-learn
On Friday, 4 May 2018 at 15:16:23 UTC, wjoe wrote: On Friday, 4 May 2018 at 14:24:36 UTC, Vino wrote: On Friday, 4 May 2018 at 14:02:24 UTC, Jonathan M Davis wrote: On Friday, May 04, 2018 13:17:36 Vino via Digitalmars-d-learn wrote: [...] Linux does not keep track of the creation time of a

Re: Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-04 Thread wjoe via Digitalmars-d-learn
On Friday, 4 May 2018 at 14:24:36 UTC, Vino wrote: On Friday, 4 May 2018 at 14:02:24 UTC, Jonathan M Davis wrote: On Friday, May 04, 2018 13:17:36 Vino via Digitalmars-d-learn wrote: On Friday, 4 May 2018 at 12:38:07 UTC, Adam D. Ruppe wrote: > What are you actually trying to do with it? These

Re: Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-04 Thread Vino via Digitalmars-d-learn
On Friday, 4 May 2018 at 14:02:24 UTC, Jonathan M Davis wrote: On Friday, May 04, 2018 13:17:36 Vino via Digitalmars-d-learn wrote: On Friday, 4 May 2018 at 12:38:07 UTC, Adam D. Ruppe wrote: > What are you actually trying to do with it? These functions > are probably the wholly wrong

Re: Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 04, 2018 13:17:36 Vino via Digitalmars-d-learn wrote: > On Friday, 4 May 2018 at 12:38:07 UTC, Adam D. Ruppe wrote: > > What are you actually trying to do with it? These functions are > > probably the wholly wrong approach. > > Hi Adam, > > The existing program in Windows do few

Re: Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-04 Thread Vino via Digitalmars-d-learn
On Friday, 4 May 2018 at 12:38:07 UTC, Adam D. Ruppe wrote: What are you actually trying to do with it? These functions are probably the wholly wrong approach. Hi Adam, The existing program in Windows do few task's eg: Delete files older that certain days, and now we are trying to port to

Re: Windows to Linux Porting

2018-05-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, May 04, 2018 10:25:28 Russel Winder via Digitalmars-d-learn wrote: > On Fri, 2018-05-04 at 08:47 +, Vino via Digitalmars-d-learn wrote: > > […] > > > Was able to resolve the issue, the issue was the letter "L" in > > > > version (Linux) where is should be version (linux). > > It

Re: Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-04 Thread Adam D. Ruppe via Digitalmars-d-learn
What are you actually trying to do with it? These functions are probably the wholly wrong approach.

Windows to Linux Porting - timeCreated and timeLastAccessed

2018-05-04 Thread Vino via Digitalmars-d-learn
Hi All, Request your help, I have a D program written on Windows platform and the program is working as expected, now i am trying to port the same program to Linux, my program use the function "timeCreated" from std.file for Windows hugely where as in Linux we do not have the same function

Re: Windows to Linux Porting

2018-05-04 Thread Vino via Digitalmars-d-learn
On Friday, 4 May 2018 at 09:25:28 UTC, Russel Winder wrote: On Fri, 2018-05-04 at 08:47 +, Vino via Digitalmars-d-learn wrote: […] Was able to resolve the issue, the issue was the letter "L" in version (Linux) where is should be version (linux). It would have helped if I had read

Re: Windows to Linux Porting

2018-05-04 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2018-05-04 at 08:47 +, Vino via Digitalmars-d-learn wrote: > […] > Was able to resolve the issue, the issue was the letter "L" in > version (Linux) where is should be version (linux). It would have helped if I had read the code first rather than jumped to a conclusion. :-) --

Re: Windows to Linux Porting

2018-05-04 Thread Vino via Digitalmars-d-learn
On Friday, 4 May 2018 at 07:43:39 UTC, Russel Winder wrote: On Fri, 2018-05-04 at 03:30 +, Vino via Digitalmars-d-learn wrote: [...] `./nasconfig.txt` perhaps: Linux uses / (as does Windows in fact) for directory separator. [...] Hi Russel, Was able to resolve the issue, the

Re: Windows to Linux Porting

2018-05-04 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2018-05-04 at 03:30 +, Vino via Digitalmars-d-learn wrote: > Hi All, > >Request you help on the below code, the below code always state > the file does not exist even if the file do exist. > > Code: > > import core.stdc.stdlib: exit; > import std.stdio; > import std.file; >

Windows to Linux Porting

2018-05-03 Thread Vino via Digitalmars-d-learn
Hi All, Request you help on the below code, the below code always state the file does not exist even if the file do exist. Code: import core.stdc.stdlib: exit; import std.stdio; import std.file; import std.path; auto osSwitch () { string ConfigFile; version (Windows) { ConfigFile =