Was this information helpful? Yes No. Thank you! Any more feedback? The more you tell us the more we can help. Can you help us improve? Resolved my issue. Clear instructions. Easy to follow. No jargon. Pictures helped. Didn't match my screen. Meanwhile, do you know how to unsync OneDrive? In this part, we will show you how to unsync OneDrive from PC. If you want to unsync OneDrive from computer, you can try these solutions.
After that, you have removed OneDrive from your computer and you will not sync files to OneDrive any longer. After all steps are finished, you have unlinked the Microsoft account and the OneDrive will not sync your files any longer. If one were to give any off-topic advice about the Unix code it would be: "don't use mktemp -- it is a ghoul from the past and there is no point in trying to replicate its various faults in new code". That might be the best possible answer to your question.
But since most of us here aren't Windows experts, you're not going to get very many other suggestions, so you can't really tell. And you should ask in a newsgroup that discusses Windows programming. Note this sentence From his post above what he wanted was a guarantee the file would be cleaned up. As the section you quoted made clear, for tmpfile this is implementation defined. Agreed, but i suspect its at least as likely the file will get used before being unlink ed, so Yes, but we both know that this is not true, in general, for the above code so it seems unlikely that the OP really needs that as a hard and fast guarantee.
All I am suggesting is that tmpfile should be the first answer when someone posts this question here. Is there any reason to think that tmpfile does not do what the OP needs when the program terminates abnormally? Maybe I am being overly generous to Windows C implementation, but surely if it can be done at all, tmpfile will do it. I think what they posted was the code they are porting at least I can't see any reason to assume otherwise at this stage.
Mark McIntyre wrote: Ben Bacarisse wrote: I suspect the unlink follows the fopen this is an old but common idiom so such a crash is not likely.
The usual trick is to unlink it directly after open ing it. As you may or may not know, as long as the unlinked file remains open, you can still use it. SaSW, Willem -- Disclaimer: I am in no way responsible for any of the statements made in the above text. For all I know I might be drugged or something.. No I'm not paranoid. You all think I'm paranoid, don't you! Ben Bacarisse wrote: Yes, but we both know that this is not true, in general, for the above code so it seems unlikely that the OP really needs that as a hard and fast guarantee.
You may be right, but I dont propose to second-guess the OP. He said he wanted a guaranteed method, C doesn't provide one, his OS may, this isn't the place to ask about that. I'd agree, except that his original question wasn't about tmpfile, and when he clarified what he wanted, tmpfile didn't fit the bill! You're having a laugh, surely.
Willem wrote: Mark McIntyre wrote: Ben Bacarisse wrote: I suspect the unlink follows the fopen this is an old but common idiom so such a crash is not likely. Kinda depends what he's trying to do. Of course you know that behaviour is entirely OS-specific. There is no need to second guess. They said they were porting code X and they wanted behaviour Y. Code X does not have behaviour Y. You chose one way to answer believe they want Y I went for the other they want something as good as or better than code X.
How can I know which of these stem from tmpfile not doing what the OP wanted? I was genuinely asking as a marginally on-topic QOI question if tmpfile leaves something visible when the plug is pulled on MS Windows.
Given the system specific comments already posted, a quick "yes" or "no" from someone who knows would not be unreasonable. I know some very good people who work for MS, and it only takes one to get tmpfile to do the right thing.
0コメント