1

Are file permissions something which are merely stored on the HDD (or other storage medium) and respected by operating systems. Or does the HDD actively enforce them in some way?

I know that if I attempt to access/modify files in any way which involves going through features provided by the operating system including use of any class/method of any programming language which actually goes through the OS/drivers then file permissions will be enforced.

What Would happen if I wrote code which directly interfaces with the HDD? Perhaps if I was to research the API a particular HDDs firmware uses and wrote code which directly sends the HDD the signals which would result in its firmware doing something. If I was to do this would file permissions have any effect?

Would it make any difference if my code required an OS which respects file permissions or not?

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
sam
  • 123
  • 1
  • 11

1 Answers1

0

The way file access permissions are stored and handled varies between filesystems and operating systems. Unix-like operating systems, for example, have a 3-digit octal number which defines who can read, write and execute which files. Windows, on the other hand, stores this information differently and doesn't have an "execute" flag in the same way as Un*x does.

If you were to write directly to the HDD without going via the OS's filesystem drivers you would have to code your own version of the filesystem - each one stores it's allocation tables, journals, etc differently.

Further Reading: https://unix.stackexchange.com/questions/201831/how-do-file-permissions-work-with-partition-filesystem

Community
  • 1
  • 1
SteJ
  • 1,491
  • 11
  • 13
  • What happens in the case of file systems which are compatible with both windows and linux (ie fat32) – sam Nov 09 '15 at 11:33