Re: How to wait for file closing?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Eureka! I will rename the file with data. The open file can't be renamed therefore collisions are impossible. Thus it is required to do a pause while the file is renamed, but with Euphoria it is simple. And on C++-part it isn't necessary to care of anything at all.

C++-part:
0. create temporary directory and set it as current
1. dump data to "thatisee"
2. wait for "turnleft", "turnrght" or "goahead"
3. obay
4. delete "turnleft", "turnrght" and "goahead"
5. if directory isn't empty, then go to 5 (I am not sure that this check is necessary)
6. go to 1

Eu-part:
1. if "thatisee" isn't exist, then go to 1
2. if (rename "thatisee" to "thatisee.tmp") is fail, then go to 2
3. if "thatisee.tmp" isn't exist, then go to 3
4. contemplate(read_lines("thatisee.tmp"))
5. rename "thatisee.tmp" to "turnleft", "turnrght" or "goahead"
6. go to 1

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu