Re: [go-nuts] Re: looking for a flexible file path resolver

2018-08-07 Thread Marvin Renich
* DrGo [180806 18:37]: > There are situations where you need to check (and report back to the user) > for file existence no matter how you do that (using Stat or by attempting > to open or create it). I agree completely. However, doesn't os.Stat do what you want here simply and portably? If

Re: [go-nuts] Re: looking for a flexible file path resolver

2018-08-06 Thread DrGo
Thanks Marvin, There are situations where you need to check (and report back to the user) for file existence no matter how you do that (using Stat or by attempting to open or create it). There are several issues with the approach you described, which is essentially what fileapth.Abs() does, som

Re: [go-nuts] Re: looking for a flexible file path resolver

2018-08-06 Thread Marvin Renich
* DrGo [180806 02:00]: > Thanks, > filepath.Abs does some of what I want, but as far as I could tell, it does > not handle resolving relative paths Does this code help out? if filepath.IsAbs(somepath) { somepath = filepath.Clean(somepath) } else { var wd, err = os.Getwd() if err !=