CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2009
    Location
    Genova - Italy
    Posts
    38

    [RESOLVED] Little issue with paths

    Hello to all

    I have a little issue with paths.

    In my C WinAPI program, I would like to know if a path exists, and also if its root exists, and so on.
    I'll make an example:

    my_path = C:\Programs\Software\MyProject

    Ok, I would like to know if my_path exists (I'll do that with PathIsDirectory() function). If my_path doesn't exists, I would like to know if C:\Programs\Software exists. If it doesn't exists, I would like to know if C:\Programs exists, and so on.
    There is a function that will split my_path into all it sub-folders? (I mean to split my_path in "C:\", "Programs", "Software", "MyProject")? Or I would do it by searching characters "\\" in the string?

    Thank you in advance!

  2. #2
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: Little issue with paths

    Maybe you can use PathRemoveFileSpec
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  3. #3
    Join Date
    Jul 2009
    Location
    Genova - Italy
    Posts
    38

    Re: Little issue with paths

    Thank you very much!
    This solved my issue!!

    Thank you again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured