bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #41721] Adding amin Test delays output to stdout or redirect to fil


From: James Youngman
Subject: [bug #41721] Adding amin Test delays output to stdout or redirect to file
Date: Sat, 26 Apr 2014 16:35:15 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36

Update of bug #41721 (project findutils):

                  Status:                    None => Invalid                
             Assigned to:                    None => jay                    
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

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



    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?41721>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]