N
N
Nicky232020-04-16 12:50:14
Qt
Nicky23, 2020-04-16 12:50:14

How to overwrite a text file in Qt C++?

Good day to all. Need advice. There is a text file, you need to delete a line from it. In the vastness of Runet, I read that this can be implemented using rewriting, but I did not find exactly how to do this. Note that the file size may be larger than the RAM size.
My version: I create the second file. And with the help of a condition, I write lines into it that do not need to be deleted. Is it correct? Or is there a way to implement everything with one file? I would like to hear other ways besides rewriting. Thank you.

Answer the question

In order to leave comments, you need to log in

7 answer(s)
G
Grigory, 2020-04-17
@Nicky23

It all depends on what you will do with this file. for example, you can replace the characters of an unnecessary line with spaces directly in the source file. and there is no data and the file is in place.

S
sainnr, 2011-06-04
@sainnr

I suggest looking towards the Yii Framework. OOP, MVC, code generation, adequate community, there is literature (in English and in Russian). There is a good book (in English ) with an example
of building a specific application using most of the features of Yii and using TDD: Jeffrey
Winesett - Agile Web Application Development with Yii 1.1 and PHP5

A
aktuba, 2011-06-04
@aktuba

I highly recommend ko3. Easier only CI probably. Yii is more complicated and much more, by the way.

D
Dmitry Bykadorov, 2011-06-05
@hudson

I've been using symfony for a long time and now I've started writing small projects on Symfony2.
Of the alternatives - Zend Framework.
And that’s all… I don’t even advise you to approach CI. The rest is up to you. Choose 3-5 pieces from the most popular ones, put which one you get into the fastest, that one will probably be your choice.

S
Sergey, 2011-06-04
@butteff

And why not use some cms, where everything is already written?
I make my stores on cmsmadesimple.org along the way adding the modules I need, or rewriting the existing ones. Very convenient, simple, light, elegant and friendly cms in my opinion.

R
rumkin, 2011-06-04
@rumkin

Look towards Silex - this is generally a microframework, everything you need can be connected from Symphony, where it (Silex) comes from. Or generally look towards microframeworks, fat-free, for example.

I
Ivan Trofimov, 2011-06-05
@cbone

If I were you, I would take the CMS and make it on it. Spend less time and get good results. I always use this option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question