Delete a Non-empty directory Programmatically

Discussion in 'C Programming' started by Raman, Oct 29, 2007.

  1. Raman

    Raman Guest

    HI All,


    Please help me understand, Is there any standard C -library function
    available that can delete non-empty the directory tree.

    Thanks and Regards,
    Raman Chalotra
    Raman, Oct 29, 2007
    #1
    1. Advertising

  2. "Raman" <> schrieb im Newsbeitrag
    news:...
    > Please help me understand, Is there any standard C -library function
    > available that can delete non-empty the directory tree.

    No. The C-Standard doesn't even know about directories. Asking in
    comp.unixprogrammer might help, but AFAIX POSIX doesn't have such a library
    function either.

    Bye, Jojo
    Joachim Schmitz, Oct 29, 2007
    #2
    1. Advertising

  3. Raman <> writes:
    > Please help me understand, Is there any standard C -library function
    > available that can delete non-empty the directory tree.


    No. Standard C has no concept of directories. Your operating system
    probably does; try a system-specific newsgroup.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Oct 29, 2007
    #3
  4. Raman

    santosh Guest

    Raman wrote:

    > HI All,
    >
    >
    > Please help me understand, Is there any standard C -library function
    > available that can delete non-empty the directory tree.


    No. Standard C does not have any concept of directories. To do this you
    need to look at extensions provided by your implementation or by your
    system to read and traverse directories. If your platform is UNIX or
    Linux post to <news:comp.unix.programmer> and if you are developing for
    Windows one possible group is
    <news:comp.os.ms-windows.programmer.win32>
    santosh, Oct 29, 2007
    #4
  5. Joachim Schmitz wrote:
    >
    > "Raman" <> schrieb im Newsbeitrag
    > news:...
    > > Please help me understand, Is there any standard C -library function
    > > available that can delete non-empty the directory tree.

    > No. The C-Standard doesn't even know about directories. Asking in
    > comp.unixprogrammer might help, but AFAIX POSIX doesn't have such a library
    > function either.


    <OT>
    My man pages state that the relevent functions are POSIX-compliant.
    </OT>

    --
    +-------------------------+--------------------+-----------------------+
    | Kenneth J. Brody | www.hvcomputer.com | #include |
    | kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
    +-------------------------+--------------------+-----------------------+
    Don't e-mail me at: <mailto:>
    Kenneth Brody, Oct 29, 2007
    #5
  6. Raman

    Raman Guest

    On Oct 29, 1:18 pm, Keith Thompson <> wrote:
    > Raman <> writes:
    > > Please help me understand, Is there any standard C -library function
    > > available that can delete non-empty the directory tree.

    >
    > No. Standard C has no concept of directories. Your operating system
    > probably does; try a system-specific newsgroup.
    >
    > --
    > Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    > San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
    > "We must do something. This is something. Therefore, we must do this."
    > -- Antony Jay and Jonathan Lynn, "Yes Minister"



    Thanks for the reply.


    Regards,
    Raman Chalotra
    Raman, Oct 29, 2007
    #6
  7. "Kenneth Brody" <> schrieb im Newsbeitrag
    news:...
    > Joachim Schmitz wrote:
    >>
    >> "Raman" <> schrieb im Newsbeitrag
    >> news:...
    >> > Please help me understand, Is there any standard C -library function
    >> > available that can delete non-empty the directory tree.

    >> No. The C-Standard doesn't even know about directories. Asking in
    >> comp.unixprogrammer might help, but AFAIX POSIX doesn't have such a
    >> library
    >> function either.

    >
    > <OT>
    > My man pages state that the relevent functions are POSIX-compliant.

    There is no POSIX funtion for that. There is a set of functions though, that
    if combined properly might do what the OP needs (and he's be given these in
    comp.unix.pogrammer), but he asked for _a function_, singular.
    > </OT>


    Bye, Jojo
    Joachim Schmitz, Oct 29, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John

    empty/non-empty element

    John, Jul 15, 2003, in forum: XML
    Replies:
    1
    Views:
    1,011
    Klaus Johannes Rusch
    Jul 16, 2003
  2. Marcia Hon

    Check if a directory is empty and empty it

    Marcia Hon, Feb 8, 2004, in forum: C Programming
    Replies:
    8
    Views:
    564
    Dave Thompson
    Feb 14, 2004
  3. =?Utf-8?B?T2xpdmllciBHSUw=?=

    Directory.Delete of a non empty dir fails in ASP.NET application

    =?Utf-8?B?T2xpdmllciBHSUw=?=, Oct 26, 2006, in forum: ASP .Net
    Replies:
    5
    Views:
    436
    Walter Wang [MSFT]
    Nov 10, 2006
  4. codeboy
    Replies:
    1
    Views:
    1,551
    Juan T. Llibre
    Jun 8, 2009
  5. Gordon
    Replies:
    1
    Views:
    214
    nolo contendere
    Apr 14, 2008
Loading...

Share This Page