disk

Are tables created with “CREATE TEMPORARY TABLE” in memory or on disk?

北慕城南 提交于 2019-11-30 04:43:32
In MySQL , when you create a temporary table, for example, CREATE TEMPORARY TABLE ... , is that table created and held in memory or on the disk? I have read through the docs and Google'd it and have not come up with an answer. It depends on what engine you specify. By default the table data will be stored on disk. If you specify the MEMORY engine, the data will only be stored in memory. It should be possible to actually find the files that are created in the filesystem when the temporary tables are created. After running the following commands: CREATE TABLE test.table_myisam (x int) ENGINE

Detect disk activity in Delphi

放肆的年华 提交于 2019-11-30 02:29:29
I'm using Delphi 2007. I am copying files to a remote drive. When the copying ends, I shutdown/standby the machine. It can happen that some files don't get copied from buffer to disk, and the remote disk gets disconnected, so the backup is not completed. I need to detect disk activity on that disk to properly be able to take the close action on the machine. Is there a way to detect disk activity in this scenario? (Please move the additional information from the comment to your question.) AFAIK there is no Windows API to tell whether all data has been written to disk. What you are looking for

boost::circular_buffer equivalent for files?

不羁的心 提交于 2019-11-30 00:32:07
问题 I am looking for a library which allows to get a circular buffer on disk. In Boost there is something similar, but it is an in memory based container: circular_buffer. 回答1: You can call it whatever you think is natural. You're looking for memory mapped files. Using the right allocator, you can make containers be allocating in this memory mapped region. That would make the container "on disk". I'll see whether Boost Circularbuffer supports this directly. Update Yes. The best thing is, this

Is it safe to delete the journal file of mongodb?

妖精的绣舞 提交于 2019-11-29 19:35:52
If I delete the 3.1G journal file, sudo service mongodb restart will fail. However, this file is taking too much space. How can I solve this problem? How can I remove it? bash$ du -sh /var/lib/mongodb/* 4.0K _tmp 65M auction_development.0 128M auction_development.1 17M auction_development.ns 3.1G journal 4.0K mongod.lock TL;DR: You have two options. Use the --smallfiles startup option when starting MongoDB to limit the size of the journal files to 128MB, or turn off journalling using the --nojournal option. Using --nojournal in production is usually a bad idea, and it often makes sense to use

Find System Hard Disk Drive from Python?

孤者浪人 提交于 2019-11-29 16:18:50
I am working on a software installer for my current application. It needs to be installed to the System HDD. How owuld I detect the system drive and return the letter from Python? Would the win32 extensions be useful? How about the os module pre packaged with Python? This is how to return the letter of the System drive on a Win32 platform: import os print os.getenv("SystemDrive") The above snippet returns the system drive letter. In my case ( and most cases on windows) C: If you install the win32 extensions, the following will get you the information you want: In [82]: import win32api In [83]:

When exactly do things get removed from urlcache's memory and disk?

半世苍凉 提交于 2019-11-29 11:47:31
let memoryCapacity = 200 * 1024 * 1024 let diskCapacity = 1 * 1024 * 1024 let cache = URLCache(memoryCapacity: memoryCapacity, diskCapacity: diskCapacity, diskPath: "myDataPath") URLCache.shared = cache Scenario1 I'm setting urlcache's memory to 200mb and setting the disk space to 1mb. Then I download an image. Turn off internet and force quit the app, launch the app again by tapping it, and trigger a call (to download image) but it immediately crashes because data is nil Needless to say if I turn off internet, it will still read from cache as expected and no crash would happen. Scenario2 If I

Force write of a file to disk

我的梦境 提交于 2019-11-29 11:02:30
I'm currently implementing a ping/pong buffering scheme to safely write a file to disk. I'm using C++/Boost on a Linux/CentOS machine. Now I'm facing the problem to force the actual write of the file to disk. Is it possible to do so irrespective of all the caching policies of the filesystem (ext3/ext4) / SO custom rules / RAID controller / harddisk controller ? Is it best to use plain fread()/fwrite(), c++ ostream or boost filesystem? I've heard that simply flushing out the file (fflush()) doesn't guarantee the actual write fflush (for FILE*), std::flush (for IOStream) to force your program to

How does one programmatically mount a drive in Windows?

我的梦境 提交于 2019-11-29 10:10:44
问题 We make and sell a device that our users will sometimes want to connect to their computer in large quantities with multiple USB hubs. It is a USB composite device that has both human interface (HID) and mass storage (MSD) interfaces. Windows automatically mounts the file-system of each device until it runs out of letters at 'Z:'. I can walk the device tree and get the device instance identifiers for the HID and USBSTOR interfaces using a combination of the PnP Configuration Manager and Device

File.WriteAllText not flushing data to disk

只愿长相守 提交于 2019-11-29 09:44:31
I've had 3 reports now of user's machines crashing while using my software.. the crashes are not related to my program but when they restart the config files my program writes are all corrupt. There is nothing special to how the files are being written, simply creating a Json representation and dumping it to disk using File.WriteAllText() // save our contents to the disk string json = JsonConvert.SerializeObject(objectInfo, Formatting.Indented); // write the contents File.WriteAllText(path, json); I've had a user send me one of the files and the length looks about right (~3kb) but the contents

How to open disks in windows and read data at low level?

点点圈 提交于 2019-11-29 04:55:09
I know in linux it is as simple as /dev/sda but in Windows how do you open a disk and start reading data at the low level? In python I've tried: f = open("K:", "r") and I get this error: Traceback (most recent call last): File "<stdin>", line 1, in <module> IOError: [Errno 13] Permission denied: 'K:' I get this error even as administrator. From http://support.microsoft.com/kb/100027 To open a physical hard drive for direct disk access (raw I/O) in a Win32-based application, use a device name of the form \\.\PhysicalDriveN where N is 0, 1, 2, and so forth, representing each of the physical