help with CHDIR function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • manontheedge
    New Member
    • Oct 2006
    • 175

    help with CHDIR function

    I'm using a function in some C++ code in visual studio .NET 2003 that uses the chdir command. For example, if I want to change the working directory to the C: ( the hard drive ), I just put

    Code:
     int result = _chdir( "C:/" );
    and the result is zero, meaning success. However, if I try ANY other drive, spefically CD or DVD drives, the result is -1, meaning it couldn't find the drive. Can anyone tell me what the problem might be, or turn me in the right direction to figure this out. Thanks.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    There was a CD/DVD in the drive when you ran the code?

    Comment

    • manontheedge
      New Member
      • Oct 2006
      • 175

      #3
      yes, I tried with a DVD and then with a CD ... got same result

      Comment

      • manontheedge
        New Member
        • Oct 2006
        • 175

        #4
        Okay, I am sorry for wasting your time, but I do appreciate the quick response. I did not realise I had a blank disk. It works when a disk is inserted that has data, but not a blank one ......

        Comment

        Working...