Changeset 1084 for trunk/eraser6


Ignore:
Timestamp:
6/2/2009 1:51:03 AM (6 years ago)
Author:
lowjoel
Message:

Use StreamInfo?.Open to get the handle to the file to list ADSes since that allows us to determine whether a file is locked (FileLoadException? will be thrown instead of plain ol' IOException)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser6/Eraser.Util/File.cs

    r1005 r1084  
    4545        { 
    4646            List<string> result = new List<string>(); 
    47             using (FileStream stream = new FileStream(info.FullName, FileMode.Open, 
     47            using (FileStream stream = new StreamInfo(info.FullName).Open(FileMode.Open, 
    4848                FileAccess.Read, FileShare.ReadWrite)) 
    49             { 
    50                 SafeFileHandle streamHandle = stream.SafeFileHandle; 
    51  
     49            using (SafeFileHandle streamHandle = stream.SafeFileHandle) 
     50            { 
    5251                //Allocate the structures 
    5352                KernelApi.NativeMethods.WIN32_STREAM_ID streamID = 
Note: See TracChangeset for help on using the changeset viewer.