Re: Check if a directory is empty and empty it

From: Peter Pichler (pichlo7_at_pobox.sk)
Date: 02/08/04


Date: Sun, 8 Feb 2004 18:35:49 -0000


"Marcia Hon" <Marcia_Hon@hotmail.com> wrote in message
news:522c3fc.0402081018.4a6bfd35@posting.google.com...
> I would like to know how the following may be accomplished in C:
>
> 1. Check if a directory is empty.
> 2. Empty the directory.
>
> Please if you know how could you state what statements in C would
accomplish this?

Marcia,

Please be aware that this newsgroup discusses the C language as defined by
the ISO standard, sometimes also refered to as ANSI C. In standard C, there
are no such things like directories. True, there are files in C, but to do
anything with them, you must know their names, so standard C is not good for
your purpose. You will need to use some language extension for your
platform. These may be different depending on whether you want to program
for DOS, Windows, OS/2, Open VM, Macintosh, Linux, Unix, DeathStation 9000
OS (in increasing order of preference).

Please consult the manual coming with your implementation or ask in a
newsgroup relevant to your compiler and/or operating system.

HTH,

Peter



Relevant Pages

  • Re: Sending data to the parallel port
    ... >the C standard. ... The C language simply does not supply a way to ... >accomplish this. ... the Beyond Logic site is full of non-standard ...
    (comp.lang.c)
  • Re: Disable or delete standard dictionary
    ... I don't think there's any good way to accomplish what you propose. ... The problem is that the custom dictionary requires an activated "standard ... dictionary", of some language, in order to be available. ... This reply is posted in the Newsgroup; please post any follow question or ...
    (microsoft.public.word.docmanagement)
  • Re: Cannot write file, cannot do variable length packets
    ... "Marcia Hon" wrote in message ... If you want help with the standard i/o parts ', ... standard code, and ask specific questions about it. ... compiler and/or OS documenation. ...
    (comp.lang.c)
  • Re: why cant functions return arrays
    ... Any possibility to change the standard and return arrays? ... what is the path to accomplish that? ... If no, what is the purpose ... The standard is very unlikely to change. ...
    (comp.lang.c)
  • Re: `string->number vs. `read
    ... Erm, if they accomplish the same thing then you can use one wherever ... I haven't memorized the standard yet so I'm not ... Take care, ...
    (comp.lang.scheme)