How do you algorithmise the detection of MA feed clusters? - page 13

 

Open:

int file_handle=FileOpen("test.bin",FILE_WRITE|FILE_READ|FILE_BIN);

Then go to the end of the file with FileSeek()

 
Dmitry Fedoseev:

Open:

Then go to the end of the file with FileSeek()

Dmitry thanks, good article.

Can I ask you a question, if an existing file is opened with a write-only flag it will immediately overwrite empty, at the time of opening, or at the time of the first write?

It is clear that without read flag we can't get to the end, so we can't save content of file at this opening, but I noticed that even without writing, only opening the file lost content.

 
Valeriy Yastremskiy:

Dmitry, thank you, good article.

Can I ask a question, if an existing file is opened with write-only flag it will be overwritten empty at the moment of opening, or at the moment of the first write?

It is clear that without the read-only flag we can't get to the end, so we can't save the contents of the file when opening it this way, but I noticed that even without writing, when opening it only, the file would lose its contents.

You can do an experiment - open, do not write and close - the file will be empty. It follows that the file is cleaned when it is opened.

What is there to notice? It is designed that way.

 
Dmitry Fedoseev:

You can do an experiment - open, do not write and close - the file will be empty. It follows that the file is cleaned when it is opened.

What is there to notice? It is designed that way.

Who will check, let me know what the result is.

 
Farkhat Guzairov:

Who will check, let me know what the result is.

Checked, but not like this, after opening a non-empty file to write, my write functions are not empty and start after 100 sec. If I don't wait and close the files, the files are empty. I put also for reading, then the contents of the file began to remain. and did not erase the first record, if the cursor is not sent to the end, writes to the beginning of the file.

 
Valeriy Yastremskiy:

Checked, but not like this, after opening a non-empty file to write I have the write functions not empty and start after 100 sec. If I don't wait and close the files, the files are empty. I put also for reading, then the contents of the file began to remain. and did not erase the first record, if the cursor is not sent to the end, writes to the beginning of the file.

I have also encountered this, but have not been able to overcome it.

 
Farkhat Guzairov:

So, I've encountered this too, and I can't get rid of it.

What did you encounter and what didn't you overcome?

 
Farkhat Guzairov:

I also encountered this, but could not overcome it.

I've overcome it all) It writes both at the beginning and, if necessary, at the end of the file. All works, you can even in the middle if you want).

 
Dmitry Fedoseev:

What have you encountered and what haven't you solved?

I understand what the problem is, if you write at the beginning of the file, the lines are overwritten, not shifted)))

Is it possible to insert lines with the lower ones shifted down?

 
Valeriy Yastremskiy:

I think it worked) It writes at the beginning and, if necessary, at the end of the file. Everything works, you can even write to the middle if you want).

At the beginning and in the middle, it does not reset the file contents and overwrites.

Reason: