[EMAIL PROTECTED] writes: > I'm using sort to merge sort two very large inputs, one being from stdin. > It's working slower than I would like because sort creates a temp file > when stdin is an input, I think, to keep from possibly clobbering input > files.
Yes, that's the basic idea. > Would it be safe to put in a check that says if stdout is the output, that > it could safely not create temp files? I don't think so. Consider the following somewhat-contrived example: sort -m -o - f1 f2 1<>f1 Here standard output points to the start of the regular file "f1". If "sort" doesn't copy f1 before writing to standard output, it will trash its input before reading it. > I don't understand the current behavior for stat on the output > file. Why when it fails does it just return nfiles? If "sort" can't stat the output file, then it can behave as if the output file does not exist, so it doesn't need to worry about whether the output file overlaps one of the inputs, and it can return nfiles (which means, please merge as much as possible). Could you please try the following patch instead? If it solves your problem, we're done, as it has already been installed in CVS coreutils. If not, I'd like to know more about your problem, e.g., a test case. Thanks. http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00076.html _______________________________________________ Bug-coreutils mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/bug-coreutils
