-
May 15th, 2022, 08:21 PM
#1
How to get file permissions that are associated with a file?
This is what I have:
Code:
using System;
using System.IO;
using System.Text;
namespace File_Permissions
{
class Start {
static void Main(string[] args)
{
string dir = "dummy";
string dir_fil = "dummy/test.txt";
FileAttributes attributes = File.GetAttributes(dir);
System.Console.WriteLine(" These are the directory 'dummy' attributes : " + attributes.);
}
}
}
What I'm trying to do is get the attributes of a file/directory that you normally would see when you try to view the "Properties" on a file. I've found these examples, but it's kind of lacking:
https://www.tutorialspoint.com/file-...sions-in-chash
What's the best way to view _all_ of these properties? Specifically, I'd like to know how to view permissions, owner, etc. and then print all of this out to the console.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|