MoveAFlileFromPCToFlashDriveUsingDMA

Hello, guys, how can i move my "sample.txt" file from my PC (NTFS) to a flash drive (FAT32) using DMA or programm interrupt in my cpp programm?
File system specifics and DMA are way too much "low-level" for a normal user-space application.

That's something that you'd mess with, if you were to write an operating system kernel or a device driver.

In a normal user-space C/C++ program, you'd use something like MoveFileExW() with the proper paths:
https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexw

The underlying operating system and its device drivers almost certainly already are using DMA :-)


If you really want to create your own device driver, then have a look at:
https://en.wikipedia.org/wiki/Windows_Driver_Kit
Last edited on
And if the OP is looking for something less Win-centric and more C++ there is C++17's filesystem library.
https://en.cppreference.com/w/cpp/filesystem

Windows does "choke" on UTF-X strings, sadly. See https://en.cppreference.com/w/cpp/filesystem/path/path for an example, paths p3 and p4 go *ka-blooie!* when executed. Though the example compiles without even a whimper.

Maybe it is an artifact of using Visual Studio. I'm too lazy to try another compiler/IDE on my Win development machine to test this.
Registered users can post here. Sign in or register to post.