Re: Unix C programming for finding file

From: Måns Rullgård (mru_at_inprovide.com)
Date: 11/24/04


Date: Wed, 24 Nov 2004 16:34:29 +0100

dawn <ming@lian.com> writes:

> Hi all,
> I am now working on a C program under Unix.
> The requirement for the program is that:
> A file name is passed to program as a parameter. The program
> will Find files under a specified directory. The matched file
> must have the same content with the given file. It does not
> matter whether the filenames are the same.

find dirname -type f -exec cmp -s filename {} \; -print

-- 
Måns Rullgård
mru@inprovide.com


Relevant Pages

  • Re: Clients using a GUI to access FTP
    ... I wouldn't suggest mapping VMS names to Unix names. ... VMS filenames onto a Unix directory, ...
    (comp.os.vms)
  • Re: spaces in filenames or directories when using graphics
    ... RB>> Tl 2004) if one can actually use spaces in directory-names or file names ... RB>> By testing on my TeX Live 2004, I cannot get it working with dvips. ... TeX ITSELF barfs at filenames with spaces. ... *UNIX* itself has allowed all sorts of weird characters in file names ...
    (comp.text.tex)
  • Re: Reintroducing fish, the friendly interactive shell
    ... globbing and is more suitable for matching filenames than the ... but Unix barely exists anyway. ... on any Unix, as long as you use zsh, as I specified:-b ... the same way most other unix commands do. ...
    (comp.unix.shell)
  • Re: Clients using a GUI to access FTP
    ... I wouldn't suggest mapping VMS names to Unix names. ... VMS filenames onto a Unix directory, ... Most files are created as lowercase because that is they way they ...
    (comp.os.vms)
  • Re: OT: Re: MAC users?
    ... systems can be case-sensitive to filenames so watch for that". ... Bob's characterization of magic numbers and 'file' as some kind of Unix ... you wrote that reliance on filename extensions is "the sort of ... Windows is an easy target, but bashing it while praising Unix (for ...
    (soc.genealogy.computing)