Josh
Josh

Reputation: 2339

How can I create a file starting at a specific sector on the disk?

How can I create a file starting at a specific sector on the disk in Windows? Any programming language is acceptable. If it matters, the file system I am interested in is NTFS.

Upvotes: 1

Views: 1532

Answers (2)

Harry Johnston
Harry Johnston

Reputation: 36318

You cannot create a file at a specific sector, but once you've created a file you can move it using the FSCTL_MOVE_FILE IO control code. There's no guarantee that it won't be moved again later on, though.

Upvotes: 3

Daren Thomas
Daren Thomas

Reputation: 70324

Read the source for cygwins dd command. That should point you in the right direction. I hope you know what you are doing. And: Don't do this to the system disk...

Upvotes: 0

Related Questions