Format Drive in Python

后端 未结 2 924
悲哀的现实
悲哀的现实 2021-01-07 08:55

I\'m attempting to make a Python 3.3 program to format a drive in Windows such as a SD Card or USB Stick. I tried the code here: http://bytes.com/topic/python/answers/537724

相关标签:
2条回答
  • 2021-01-07 09:04

    I found the solution! This line:

     FMIFS_HARDDISK = 0x0C
    

    should be like this

     FMIFS_UNKNOWN = 0
    

    That simply makes it format by Unknown!

    0 讨论(0)
  • 2021-01-07 09:12

    I've looked long and hard for documentation of the windows calls, I could not find anything on Microsoft that matched how FormatEx is called here.

    Finally I've found this: http://doxygen.reactos.org/df/d85/fmifs_8h_source.html

    Here you can find how to set the cluster size for example.

    0 讨论(0)
提交回复
热议问题