English 中文(简体)
fs.write(); fs.flush(); 何时真的写到磁盘上? 哪怕是空洞或断电?
原标题:fs.write(); fs.flush(); When is it really written to disk? What if kernel-panic or power outage?

我需要用一些原写文字进行二级储存。 我怎么能够证明这种ool弄?

如果我打开C#文档,则使用档案处理。 开放我将接受处理。 我可以向它撰写一些数据。 挥霍并关闭。 但我仍有一些问题。 我猜测以下陈述是真实的?

  • 数据可能不是用软盘书写的,而是存在于Windows Disk的海滩上。

  • 数据可能不是用磁盘书写的,而是存在于HDD海滩。

And this will lead to the following issues:

  • 停电将使得I号档案中的ed(关于像国家食品安全局这样的交易性金融服务)重新出现。

  • A kernel-panic will make the edits in the file I made reverted (On a transactional FS like NTFS)

Am I correct in my assumptions? If so, how can I make a fool proof write to the disk? I have looked a little bit into NoSQL and have been thinking there might be a nosql server that could talk to the system closer to the hardware and not return to me software until it can guarantee that the bytes are written to disk.

欢迎所有观点和想法。

Jens

[edit] Maybe there is a specific amount of time I can wait before being sure that all changes are written to physical disk?

问题回答

完全“冷藏证据”运作的唯一途径是,管理并证实。 货物滞留在电梯,在确认之前,或者如果确认为“滚动后退”,可以再次处理。

你谈论的时间之窗非常小,假设你不牵涉一个网络(每个地方)。 然而,如果你想确保事情,你会问他们。 MSMQ是一种选择。 如果数据来源于SQ服务器,你可以认为它是中介机构(不是建议这一方向,而是采取的一种方式)。

Ultimately, the idea here is a lot like a handshake, as used in most server to server communication. Everyone agrees things are done before both sides get rid of their piece of the work.

I am not an expert in Windows internals, but I believe you are correct. I didn t test it in great detail, but was able to use MSMQ as a pretty reliable place to store data, with another process that monitored the queue for final processing.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签