bugfindutils - Bugs: bug #41721, Adding amin Test delays output to...

 
 

bug #41721: Adding amin Test delays output to stdout or redirect to file

Submitted by:  ken <bken>
Submitted on:  Thu 27 Feb 2014 01:18:20 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Open/Closed: Closed
Release: 4.2.27Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 26 Apr 2014 04:35:15 PM UTC, comment #1:

~/source/GNU/findutils$ rm -f /tmp/TRACE-simple.txt /tmp/test-simple.find /tmp/TRACE-complex.txt /tmp/test-complex.find; \
strace -tt -o /tmp/TRACE-simple.txt /home/james/source/GNU/findutils/installed-64/bin/find-4.2.27 . -type f > /tmp/test-simple.find ; \
strace -tt -o /tmp/TRACE-complex.txt /home/james/source/GNU/findutils/installed-64/bin/find-4.2.27 . -type f -amin -1440 -a -amin +30 > /tmp/test-complex.find

~/source/GNU/findutils$ for f in /tmp/TRACE-simple.txt /tmp/TRACE-complex.txt ; do echo; echo "${f}"; sed -n -f firstwrite.sed < "${f}"; sed -n -e '$ p' < "${f}"; done

/tmp/TRACE-simple.txt
17:17:07.195124 execve("/home/james/source/GNU/findutils/installed-64/bin/find-4.2.27", ["/home/james/source/GNU/findutils"..., ".", "-type", "f"], [/* 42 vars */]) = 0
17:17:07.216931 write(1, "./xfind/patch-for-findutils-4.1."..., 4096) = 4096
17:17:14.894501 exit_group(1) = ?

/tmp/TRACE-complex.txt
17:17:14.901656 execve("/home/james/source/GNU/findutils/installed-64/bin/find-4.2.27", ["/home/james/source/GNU/findutils"..., ".", "-type", "f", "-amin", "-1440", "-a", "-amin", "+30"], [/* 42 vars */]) = 0
17:17:22.103478 write(2, "/home/james/source/GNU/findutils"..., 63) = 63
17:17:40.617822 exit_group(1) = ?

As you can see in the second example, there is a significant delay between find's start and the first output. This is because more conditions are specified, so fewer files match. But there is also a significant delay between the first output and the program exit. This demonstrates that the output is not being written at the end of the execution of the program.

You're likely also seeing the effect of stdio buffering. See http://www.gnu.org/software/libc/manual/html_node/Stream-Buffering.html for a brief explanation.

Lastly, findutils 4.2.27 (the release against which you made this bug report) is very old now (it was released on 2005-12-06). Please upgrade.

James Youngman <jay>
Project AdministratorIn charge of this item.
Thu 27 Feb 2014 01:18:20 PM UTC, original submission:

consider the 2 commands below.

find . -type f > ~/test.find
output is immediately sent to file

find . -type f -amin -1440 -a -amin +30 > ~/test.find
output is not sent to file until find completes task

the negative side effect is that when you tail and follow test.find for the 2nd command, you can't monitor found files as find locates them.

ken <bken>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jay (Posted a comment)
  • -unavailable- added by bken (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 26 Apr 2014 04:35:15 PM UTCjayStatusNone=>Invalid
      Assigned toNone=>jay
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1