www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/24/21:14:53

From: j DOT aldrich6 AT genie DOT com
Message-Id: <199603250148.AA209558480@relay1.geis.com>
Date: Mon, 25 Mar 96 01:34:00 UTC 0000
To: djgpp AT delorie DOT com
Mime-Version: 1.0
Subject: Question about 'find' in DOS

I have recently run into an odd problem using the 'find' utility included
with DJGPP.  I ran through the info file that came with it and didn't see
anything that might help.  The problem is that when find passes the
results of its search to another program via -exec or -ok, it uses Unix
directory separators, not DOS.  This causes any DOS program you
invoke with find to work incorrectly.  Look at this example, which is
what prompted me to ask the question:

find . -name "*.o" -not -name "fight.o" -exec del {} ';'

This fails completely to delete any files, and when I use -ok instead
of -exec, we see why...

<del ... ./act_info.o> ?

del wants backslashes, not forward slashes, but I can't figure out any
way to tell find to format its output this way.  I did some experiments with
-printf, and succeeded in displaying the filenames without directory
separators (the %f specifier), but that only worked with printing, not
executing.

As a separate question, has anybody ported xargs to DJGPP yet?

Thanks,
    John

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019