Re: [HACKERS] pg_ls_waldir() & pg_ls_logdir()

2017-03-17 Thread Dave Page
On Thu, Mar 16, 2017 at 7:05 PM, Robert Haas wrote: > On Thu, Mar 16, 2017 at 6:09 AM, Dave Page wrote: >> Hmm, good point. Google seems to be saying there isn't one. Patch >> updated as you suggest (and I've added back in a function declaration >> that

Re: [HACKERS] pg_ls_waldir() & pg_ls_logdir()

2017-03-16 Thread Robert Haas
On Thu, Mar 16, 2017 at 6:09 AM, Dave Page wrote: > Hmm, good point. Google seems to be saying there isn't one. Patch > updated as you suggest (and I've added back in a function declaration > that got lost in the rebasing of the last version). OK, I took another look at this:

Re: [HACKERS] pg_ls_waldir() & pg_ls_logdir()

2017-03-16 Thread Dave Page
On Thu, Mar 16, 2017 at 9:54 AM, Thomas Munro wrote: > On Thu, Mar 16, 2017 at 10:40 PM, Dave Page wrote: >>> +const int n = snprintf(NULL, 0, "%lld", attrib.st_size); > > I wonder what the portable printf directive is for off_t. Maybe >

Re: [HACKERS] pg_ls_waldir() & pg_ls_logdir()

2017-03-16 Thread Thomas Munro
On Thu, Mar 16, 2017 at 10:40 PM, Dave Page wrote: >> +const int n = snprintf(NULL, 0, "%lld", attrib.st_size); I wonder what the portable printf directive is for off_t. Maybe better to use INT64_FORMAT and cast to int64? -- Thomas Munro http://www.enterprisedb.com

Re: [HACKERS] pg_ls_waldir() & pg_ls_logdir()

2017-03-16 Thread Dave Page
Hi On Wed, Mar 15, 2017 at 5:27 PM, Robert Haas wrote: > On Mon, Feb 20, 2017 at 6:21 AM, Dave Page wrote: >> Patch includes the code and doc updates. > > Review: > > +strftime(mtime, 25, "%Y-%m-%d %H:%M:%S %Z", > localtime(&(attrib.st_ctime)));

Re: [HACKERS] pg_ls_waldir() & pg_ls_logdir()

2017-03-15 Thread Robert Haas
On Mon, Feb 20, 2017 at 6:21 AM, Dave Page wrote: > Patch includes the code and doc updates. Review: +strftime(mtime, 25, "%Y-%m-%d %H:%M:%S %Z", localtime(&(attrib.st_ctime))); +const int n = snprintf(NULL, 0, "%lld", attrib.st_size); +char size[n+1];