Thread: Directory help.

  1. #1
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483

    Directory help.

    Ok i am trying to make a program that deletes only a specific location on a floppy disk..

    but it doesn't seem to be working...

    Code:
    #include <iostream>
    #include <stdlib.h>
    
    
    using namespace std;
    
    
    int main()
    {
    	system("del A:\\delete directory");
    
    	system("PAUSE");
    	return 0;
    }

    It says that system could not find the directory...

    But it works if there is no spaces on the directory...

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Not every compiler will have a system() command which allows spaces in filenames.

    Try perhaps
    Code:
    system("del \"A:\\delete directory\"");
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483
    EDIT:

    nvm i fixed it

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    How?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483
    It gave me an error that said device not ready...

    but it was because i had a read-only floppy disk or something.. i changed the floppy disk and it works

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to tell if a file or directory
    By swappo in forum C++ Programming
    Replies: 4
    Last Post: 07-07-2009, 10:57 AM
  2. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  3. Couple errors please help :-D
    By JJJIrish05 in forum C Programming
    Replies: 9
    Last Post: 03-06-2008, 02:54 AM
  4. Replies: 6
    Last Post: 07-30-2003, 03:08 AM
  5. Directory reading trouble
    By samGwilliam in forum Linux Programming
    Replies: 0
    Last Post: 03-10-2002, 09:43 AM