Forum > Operating Systems

Get file/folder and their permissions on Windows

<< < (2/3) > >>

ASerge:

--- Quote from: ezlage on June 03, 2020, 07:33:56 pm ---Different machines too, also, different folders. It will be necessary to save folders permissions too.

--- End quote ---
In this form, the problem has no solution. On different machines, permissions may be incompatible in principle (different users, groups, and domains). Need to limit the requirements in some way.

ezlage:

--- Quote from: ASerge on June 04, 2020, 12:01:06 am ---
--- Quote from: ezlage on June 03, 2020, 07:33:56 pm ---Different machines too, also, different folders. It will be necessary to save folders permissions too.

--- End quote ---
In this form, the problem has no solution. On different machines, permissions may be incompatible in principle (different users, groups, and domains). Need to limit the requirements in some way.

--- End quote ---

So, how a backup software works? I mean, I can start a backup right now and restore files, folders and permissions anywhere. I need to write something like this with Lazarus and FPC.

Thank you very much!

440bx:

--- Quote from: ezlage on June 04, 2020, 12:54:01 am ---So, how backup software works?

--- End quote ---
Backup software and, just about any piece of software that does file handling, is operating system specific.  IOW, it uses services that are O/S specific to open files, get their sizes, permissions, attributes, etc.

The Pascal RTL and C's stdlib (among others) can, and do, hide some of the differences among various O/S(s) but, they can only go so far safely.  In addition to that, when it comes to backing up files, different O/S(s) provide different services that differ greatly in methodology and implementation.

ezlage:

--- Quote from: 440bx on June 04, 2020, 01:19:56 am ---
--- Quote from: ezlage on June 04, 2020, 12:54:01 am ---So, how backup software works?

--- End quote ---
Backup software and, just about any piece of software that does file handling, is operating system specific.  IOW, it uses services that are O/S specific to open files, get their sizes, permissions, attributes, etc.

The Pascal RTL and C's stdlib (among others) can, and do, hide some of the differences among various O/S(s) but, they can only go so far safely.  In addition to that, when it comes to backing up files, different O/S(s) provide different services that differ greatly in methodology and implementation.

--- End quote ---

Thanks 440bx!

Thanks ASerge!

I will take a look at Microsoft documentation and try to figure out the Windows API routines capable of export File and Folder security info.

TRon:
@ezlage,
Since (hidden) streams are a filesystem specific feature, you should be looking at NTFS documentation.

That m$ decided to make use of this feature is another matter, and yes it might be able to help you out as they had to implement provisions for that.

What is definitely not going to work, as already mentioned, is doing this across platforms. You might be able to get away with certain things as long as the platform is similar, but even then you have to deal with a lot of specifics (as already mentioned).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version