473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Delete a Non-empty directory Programmatically

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

Oct 29 '07 #1
6 2913
"Raman" <ra***********@gmail.comschrieb im Newsbeitrag
news:11**********************@q5g2000prf.googlegro ups.com...
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
Oct 29 '07 #2
Raman <ra***********@gmail.comwrites:
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) ks***@mib.org <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"
Oct 29 '07 #3
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.programmerand if you are developing for
Windows one possible group is
<news:comp.os.ms-windows.programmer.win32>

Oct 29 '07 #4
On Oct 29, 1:18 pm, Keith Thompson <ks...@mib.orgwrote:
Raman <ramanchalo...@gmail.comwrites:
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) ks...@mib.org <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

Oct 29 '07 #5
Joachim Schmitz wrote:
>
"Raman" <ra***********@gmail.comschrieb im Newsbeitrag
news:11**********************@q5g2000prf.googlegro ups.com...
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:Th*************@gmail.com>
Oct 29 '07 #6
"Kenneth Brody" <ke******@spamcop.netschrieb im Newsbeitrag
news:47***************@spamcop.net...
Joachim Schmitz wrote:
>>
"Raman" <ra***********@gmail.comschrieb im Newsbeitrag
news:11**********************@q5g2000prf.googlegr oups.com...
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
Oct 29 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Jakob Bieling | last post by:
Hi, is it possible to get the address of operator new/delete and operator new/delete portably? Otherwise I would have to go for a non-portable and rather unclean solution. Thanks for any...
1
by: Nimmi Srivastav | last post by:
There's a rather nondescript book called "Using Borland C++" by Lee and Mark Atkinson (Que Corporation) which presents an excellent discussion of overloaded new and delete operators. In fact there...
11
by: Jonan | last post by:
Hello, For several reasons I want to replace the built-in memory management with some custom built. The mem management itlsef is not subject to my question - it's ok to the point that I have...
5
by: mandatory | last post by:
hi, i have a pointer to a class, which is dynamically allocated with new. myClass *mC = new myClass(); What if i at a later point in my code i have this: void *pointer;
2
by: Dave | last post by:
Hello all, I'd like to find a source on the web that discusses, in a comprehensive manner and in one place, everything about new / delete. It should include overloading operator new, the new...
9
by: groleo | last post by:
Hi list. Simple question: is it possible to override the global new/delete operators, without using malloc/free? I mean something in the ideea of the code below, which doesnt work cause of...
15
by: Dilip | last post by:
I am aware that the C++ standard in its present form does not say anything about threads, however I do have a relevant question. I am working on Windows XP/VC++ 8.0. Is there a problem new'ing...
5
by: tom | last post by:
Hi, I'm overriding my operator new and operator delete for two classes, one inherited from the other, so I can use my own memory pool. A simplified version of what I have is below: class...
31
by: Anamika | last post by:
Hello friends.... can anyone tell me what will happen when we do..."delete this"...
15
by: LuB | last post by:
I am constantly creating and destroying a singular object used within a class I wrote. To save a bit of time, I am considering using 'placement new'. I guess we could also debate this decision -...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.