Check for UNC Path and non-UNC Path Pointing to the Same Folder


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Check for UNC Path and non-UNC Path Pointing to the Same Folder

  1. #1
    Larry Rebich Guest

    Check for UNC Path and non-UNC Path Pointing to the Same Folder

    I need to determine if a UNC [universal naming convention] path points to
    the same place as non-UNC path, for example:

    \\Dell7500\c\MyFolder and
    c:\MyFolder

    point to the same folder. 'Dell7500' is the name of the local computer.

    In my application I copy files from one folder to the other folder if the
    paths are different. In the above example the names are different but they
    both point to the same folder. So when I attempt to copy I get an access
    error [as I should] because I am attempting to copy the same file onto
    itself. And I don't need to copy the file at all.

    Is there an API that will compare a UNC with a non-UNC and report they are
    both pointing to the same folder? In other words, let me know they both
    point to the same place.

    Thanks and Cheers,
    Larry Rebich

    larry@buygold.net
    www.buygold.net





  2. #2
    Karl E. Peterson Guest

    Re: Check for UNC Path and non-UNC Path Pointing to the Same Folder

    Hi Larry --

    See UncName.zip on my site for examples of how to call NetEnumShare on both NT and
    9x. That oughta be the first step in your finding your solution.

    Later... Karl
    --
    http://www.mvps.org/vb


    "Larry Rebich" <lrebich@earthlink.net> wrote in message
    news:393dcef5@news.devx.com...
    > I need to determine if a UNC [universal naming convention] path points to
    > the same place as non-UNC path, for example:
    >
    > \\Dell7500\c\MyFolder and
    > c:\MyFolder
    >
    > point to the same folder. 'Dell7500' is the name of the local computer.
    >
    > In my application I copy files from one folder to the other folder if the
    > paths are different. In the above example the names are different but they
    > both point to the same folder. So when I attempt to copy I get an access
    > error [as I should] because I am attempting to copy the same file onto
    > itself. And I don't need to copy the file at all.
    >
    > Is there an API that will compare a UNC with a non-UNC and report they are
    > both pointing to the same folder? In other words, let me know they both
    > point to the same place.
    >
    > Thanks and Cheers,
    > Larry Rebich
    >
    > larry@buygold.net
    > www.buygold.net
    >
    >
    >
    >




  3. #3
    Karl E. Peterson Guest

    Re: Check for UNC Path and non-UNC Path Pointing to the Same Folder

    Hi Larry --

    See UncName.zip on my site for examples of how to call NetEnumShare on both NT and
    9x. That oughta be the first step in your finding your solution.

    Later... Karl
    --
    http://www.mvps.org/vb


    "Larry Rebich" <lrebich@earthlink.net> wrote in message
    news:393dcef5@news.devx.com...
    > I need to determine if a UNC [universal naming convention] path points to
    > the same place as non-UNC path, for example:
    >
    > \\Dell7500\c\MyFolder and
    > c:\MyFolder
    >
    > point to the same folder. 'Dell7500' is the name of the local computer.
    >
    > In my application I copy files from one folder to the other folder if the
    > paths are different. In the above example the names are different but they
    > both point to the same folder. So when I attempt to copy I get an access
    > error [as I should] because I am attempting to copy the same file onto
    > itself. And I don't need to copy the file at all.
    >
    > Is there an API that will compare a UNC with a non-UNC and report they are
    > both pointing to the same folder? In other words, let me know they both
    > point to the same place.
    >
    > Thanks and Cheers,
    > Larry Rebich
    >
    > larry@buygold.net
    > www.buygold.net
    >
    >
    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center