mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-05-16 09:27:10 +02:00
Updated Utilities
This commit is contained in:
parent
41474b87ac
commit
73b6c288a4
2 changed files with 38 additions and 0 deletions
|
@ -22,6 +22,17 @@ namespace Utilities
|
|||
return ListEntriesInDirectory(@"\");
|
||||
}
|
||||
|
||||
public virtual List<KeyValuePair<string, ulong>> ListDataStreams(string path)
|
||||
{
|
||||
FileSystemEntry entry = GetEntry(path);
|
||||
List<KeyValuePair<string, ulong>> result = new List<KeyValuePair<string, ulong>>();
|
||||
if (!entry.IsDirectory)
|
||||
{
|
||||
result.Add(new KeyValuePair<string, ulong>("::$DATA", entry.Size));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public Stream OpenFile(string path, FileMode mode, FileAccess access, FileShare share)
|
||||
{
|
||||
return OpenFile(path, mode, access, share, FileOptions.None);
|
||||
|
@ -59,6 +70,24 @@ namespace Utilities
|
|||
destinationStream.Close();
|
||||
}
|
||||
|
||||
public virtual bool Exists(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
GetEntry(path);
|
||||
}
|
||||
catch (FileNotFoundException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract string Name
|
||||
{
|
||||
get;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue