Re: [PATCH 3/4] dir: introduce file_size() to check the size of file

2016-06-13 Thread Pranit Bauva
Hey Torsten, On Sun, Jun 12, 2016 at 4:14 PM, Torsten Bögershausen wrote: >>> So what I understand, you want something like this: >>> >>> +ssize_t file_size_not_zero(const char *filename) >>> +{ >>> + struct stat st; >>> + if (stat(filename, ) < 0) >>> +

Re: [PATCH 3/4] dir: introduce file_size() to check the size of file

2016-06-12 Thread Torsten Bögershausen
>> So what I understand, you want something like this: >> >> +ssize_t file_size_not_zero(const char *filename) >> +{ >> + struct stat st; >> + if (stat(filename, ) < 0) >> + return -1; >> + return !!st.st_size); >> +} > > For the purpose of bisect_reset(), Yes. BTW

Re: [PATCH 3/4] dir: introduce file_size() to check the size of file

2016-06-08 Thread Pranit Bauva
Hey Torsten, On Wed, Jun 8, 2016 at 1:47 PM, Torsten Bögershausen wrote: > On 06/08/2016 09:57 AM, Pranit Bauva wrote: >> >> Hey Eric, >> >> On Wed, Jun 8, 2016 at 1:07 PM, Eric Sunshine >> wrote: >>> >>> On Tue, Jun 7, 2016 at 4:54 PM, Pranit Bauva

Re: [PATCH 3/4] dir: introduce file_size() to check the size of file

2016-06-08 Thread Christian Couder
On Wed, Jun 8, 2016 at 10:13 AM, Eric Sunshine wrote: > > I think this would be clearer if you instead added a function to > bisect--helper.c which operates at a semantically higher level than > what you have here (and drop this file_size() function). Specifically, > add

Re: [PATCH 3/4] dir: introduce file_size() to check the size of file

2016-06-08 Thread Torsten Bögershausen
On 06/08/2016 09:57 AM, Pranit Bauva wrote: Hey Eric, On Wed, Jun 8, 2016 at 1:07 PM, Eric Sunshine wrote: On Tue, Jun 7, 2016 at 4:54 PM, Pranit Bauva wrote: dir: introduce file_size() to check the size of file At times we require to see if

Re: [PATCH 3/4] dir: introduce file_size() to check the size of file

2016-06-08 Thread Eric Sunshine
On Wed, Jun 8, 2016 at 3:57 AM, Pranit Bauva wrote: > On Wed, Jun 8, 2016 at 1:07 PM, Eric Sunshine wrote: >> On Tue, Jun 7, 2016 at 4:54 PM, Pranit Bauva wrote: >>> dir: introduce file_size() to check the size of file >>>

Re: [PATCH 3/4] dir: introduce file_size() to check the size of file

2016-06-08 Thread Pranit Bauva
Hey Eric, On Wed, Jun 8, 2016 at 1:07 PM, Eric Sunshine wrote: > On Tue, Jun 7, 2016 at 4:54 PM, Pranit Bauva wrote: >> dir: introduce file_size() to check the size of file >> >> At times we require to see if the file is empty and get the size of

Re: [PATCH 3/4] dir: introduce file_size() to check the size of file

2016-06-08 Thread Eric Sunshine
On Tue, Jun 7, 2016 at 4:54 PM, Pranit Bauva wrote: > dir: introduce file_size() to check the size of file > > At times we require to see if the file is empty and get the size of the > file. By using stat we can get the file size without actually having to > open the file

[PATCH 3/4] dir: introduce file_size() to check the size of file

2016-06-07 Thread Pranit Bauva
At times we require to see if the file is empty and get the size of the file. By using stat we can get the file size without actually having to open the file to check for its contents. Mentored-by: Lars Schneider Mentored-by: Christian Couder