473,385 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,385 software developers and data experts.

How to write a delete function using stream writers and function

134 100+
I am trying to make an application which acts a bit like a database.
The only 2 problems are, that I don't know how to make a script which can delete a name in a file using streamwriters and streamreaders.
Someone who knows how to make a delete function?

Thanks in advance
Feb 10 '11 #1
1 1700
If it's file stream you are using, you can only read and write, that's how streams work. In order to delete some data from the file, you need to load the entire file into memory, ie. into a byte[] array. Then search for the data in that array, use 'removeat' method to remove the data from the array. Then write the entire amount of memory back to file.
Feb 12 '11 #2

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

Similar topics

0
by: David E. | last post by:
What is the syntax for a fixed (stream manipulation function) in a emacs environment?
6
by: komal | last post by:
hi all basically my problem is i have to write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function...
8
by: Sowen | last post by:
Hi, all I am wondering how to write bits by using ofstream? I have finished a huffman tree, but how can I write the bits to the file in order to gain compression? for example, 'A' returns a...
7
by: Abhi | last post by:
Hi all, I am using .net for C++ and I would like to write some variable values to some files. I will be using that file in many member functions of the class. So I declared the file variable...
2
by: Loane Sharp | last post by:
Hi there I'm downloading data from a remote server to my local disk using Stream.Read() and Stream.Write() (as previously suggested by Ken Tucker in this group). By and large the download and...
1
by: flash | last post by:
Need hlep to delete array only because all function is ok (inser, sort andsearch) #include <iostream.h> //functions prototype void Insert(int,int); void Delete(int,int); int...
28
by: Larax | last post by:
Best explanation of my question will be an example, look below at this simple function: function SetEventHandler(element) { // some operations on element element.onclick = function(event) {
0
by: ambikadevi | last post by:
What is the function to call the Postgres stored procedures function using ADODB? PrepareSP() function is used to call the Oracle Stored Procedure. For PHP application. Waiting for the response!
1
by: blessonin | last post by:
hi all, i want to know how to read the content of a http posted file using stream reader i am using the folloing line but an error in the last line sayin that " 'System.IO.Stream' cannot be...
0
by: Anjan Bhowmik | last post by:
Hi, I use a form to upload an image to a directory on my site (~/Images/UserName/file1.jpg). Using Server.mapPath function i get the Physical path and save the file using...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.