473,466 Members | 1,397 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help needed in regarding to deletion of a file......

60 New Member
Hi every body.
i'd write a program to copy the content of one file to another file and to delete the content of the first file. But after deleting the first file remains the harddisk(even though it has no data in it). i want to remove the file totally from the harddisk. How to implement this. I'd written the program in C and the files that i want to delete is a ".txt" or ".doc" format files.
please any one help me
Dec 1 '06 #1
5 1707
DeMan
1,806 Top Contributor
If you can see where it is, overwrite it with random data
Dec 1 '06 #2
sivadhas2006
142 New Member
Hi every body.
i'd write a program to copy the content of one file to another file and to delete the content of the first file. But after deleting the first file remains the harddisk(even though it has no data in it). i want to remove the file totally from the harddisk. How to implement this. I'd written the program in C and the files that i want to delete is a ".txt" or ".doc" format files.
please any one help me
Hi,

Can u post u r code?

Regards,
M.Sivadhas.
Dec 1 '06 #3
svsandeep
15 New Member
Hi every body.
i'd write a program to copy the content of one file to another file and to delete the content of the first file. But after deleting the first file remains the harddisk(even though it has no data in it). i want to remove the file totally from the harddisk. How to implement this. I'd written the program in C and the files that i want to delete is a ".txt" or ".doc" format files.
please any one help me

Dude,

I think you want to delete a file completely from the hardisk if i am not wrong.

i hope you know the path of the file. here is the example

#include <stdlib.h>
void main()
{
system("del c:\\delme.txt");
}

Now you can pass any command you want to run (directly or as a string) to the system function.

Regards,
ShaggY@FtF
Dec 1 '06 #4
palani12kumar
60 New Member
can you please tell me how the code works?

#include <stdlib.h>
void main()
{
system("del c:\\delme.txt");
}

In the line, system("del c:\\delme.txt");, whether the del is the dos command that we use?
Dec 2 '06 #5
horace1
1,510 Recognized Expert Top Contributor
can you please tell me how the code works?

#include <stdlib.h>
void main()
{
system("del c:\\delme.txt");
}

In the line, system("del c:\\delme.txt");, whether the del is the dos command that we use?
yes, the parameter to system() is as though you were typing at the Command Prompt (the DOS prompt as it was called), e.g. you can
Expand|Select|Wrap|Line Numbers
  1.     system("dir *.c");
  2.  
to get a directory listing
Dec 2 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ralph Freshour | last post by:
I have a function that I call to check or uncheck all checkboxes on a form - I use a 'master' checkbox to do this much like hotmail has to check all mail messages - the code works fine if I name my...
11
by: William Payne | last post by:
Ok, in my program I have a std::list<Document*>, where Document is one of my own classes. I need to go through this list and check each item if it's ready for deletion. If it's not, skip to...
6
by: Jamal | last post by:
I am working on binary files of struct ACTIONS I have a recursive qsort/mergesort hybrid that 1) i'm not a 100% sure works correctly 2) would like to convert to iteration Any comments or...
4
by: Tarique Jawed | last post by:
Alright I needed some help regarding a removal of a binary search tree. Yes its for a class, and yes I have tried working on it on my own, so no patronizing please. I have most of the code working,...
3
by: A_Republican | last post by:
I am interested in writing my own secure file deletion program. I want to be able to read and write to my hard drive directly. My application will seach my hard drive for all locations marked for...
7
by: Sanket80 | last post by:
Hi I need one small help in VB I have written a macro which produces some output and stores them in the form of an excel files (about 10 files are generated) in a particular directory in C:\....
0
by: ferdz3001 | last post by:
Hi, I have read some of the forums regarding deletion of log files. Just to get more information before I perform the deletion of log files. These are the steps I got: 1. db2 get db cfg <DBSID>...
13
by: prasadmpatil | last post by:
I am new STL programming. I have a query regarding vectors. If I am iterating over a vector using a iterator, but do some operations that modify the size of the vector. Will the iterator recognize...
6
by: priyajohal | last post by:
#include<fstream.h> #include<process.h> #include<stdlib.h> #include<conio.h> #include<string.h> #include<dos.h> #include<ctype.h> #include<stdio.h> void setup() void help();
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.