Getting file system object type with FileSystemWatcher

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mo

    #1

    Getting file system object type with FileSystemWatcher

    Hi,

    I am watching a directory which has sub folders. in the
    Filesystemchang ed type Created I am trying to catch if the new object
    is a file or a folder. How do I go about it? Also Is there a way to
    get the subfolder of the file which was changed added or removed?

    Thanks,
    mo

  • Peter Duniho

    #2
    Re: Getting file system object type with FileSystemWatch er

    Mo wrote:
    Hi,
    >
    I am watching a directory which has sub folders. in the
    Filesystemchang ed type Created I am trying to catch if the new object
    is a file or a folder. How do I go about it?
    Call File.GetAttribu tes() on the path and check for the
    FileAttributes. Directory flag.
    Also Is there a way to
    get the subfolder of the file which was changed added or removed?
    I don't know what that means. Files don't have subfolders.

    Pete

    Comment

    Working...