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

 
Dmitry Fedoseev:

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

Couldn't get the file to reset, the forum suggested just deleting and reopening, ))).

 
Dmitry Fedoseev:

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

Can you suggest a combination of flags to open a file so that the contents of the file are reset?

 
Farkhat Guzairov:

Couldn't reset the contents of the file, the forum suggested just deleting and reopening, ))).

So the file must be opened with read-write flags and the contents must be erased?

If you open it with write only flags, it will erase its contents but it won't read, you will have to close it and reopen with read only flags.

Apparently there is no standard function to erase the content and at the same time read is available.

 
Valeriy Yastremskiy:

I.e. the file must be opened with read-write flags and the content must be erased?

If you open with only write flag, the content will be erased, but reading is unavailable, you will have to close and open with read flag.

Apparently there is no standard feature that would erase the contents and keep the reading available.

Probably not.

 
Valeriy Yastremskiy:

I.e. the file should be opened with read-write flags, and at the same time the content should be erased?

ShouldFileDelete() be used first and then opened for reading and writing?

 
Farkhat Guzairov:

Probably not.

FileClean(); )))

 
Aleksey Nikolayev:

How about FileDelete() first and then open for reading and writing?

This is what I suggested. Sometimes you really want to shorten it by one line))))

 
Valeriy Yastremskiy:

This is what was suggested. Sometimes you really want to shorten it by one line))))

Yes, "brevity is our brother's sister")

 
Farkhat Guzairov:

Can you suggest a combination of flags to open a file so that the contents of the file are reset?

FILE_WRITE must be, and there must be no FILE_READ. Then the file will be cleared when opened.

 
Valeriy Yastremskiy:

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

Can the lines be inserted with the lower ones shifted down?

No. Unless you do a full overwrite of the file.