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 - 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.