[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    Bug#3134: kfind has problems with filenames and pathes containing whitespaces
From:       "W. Limmer" <WLimmer () web ! de>
Date:       2000-05-01 14:32:18
[Download RAW message or body]

Package: kdeutils
Version: 0.4.1 and all others until today (CVS of 2000-05-01)	

Problem:

If you use kfind with the option "contains text", kfind isn't able to
find files which contain whitespaces somewhere in filename or in upper
directory names.
(There are really people out, which are used to use spaces in filenames,
especially when they are searching in their /wi... partitions.)


Analysis:

kfind uses a pipe of "find ... | xargs egrep -l ..." for this query mode
(file kftabdlg.cpp, method KfindTabDialog::createQuery).
Following xargs separates all pathes/filenames with whitespaces into two
or more arguments/filenames for egrep, which -of course- tries to access
non existing files and skips the required files.


Suggested solution:

Use the options "-print0" for (gnu)find and "--null" for xargs:
> "find path [options]    -print0    | xargs   --null    egrep -l[i] regex"
With this options, find generates a NUL-seperated list of filenames and
xarg expects the list in this format. Neither whitespaces nor other ugly
characters (including quotation marks and linefeeds, if somebody really
likes to use them) in directory/filenames can disturb the pipe of find
to xargs.


Life long and prosposer,
Walter Limmer

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic