Directory help.

This is a discussion on Directory help. within the C++ Programming forums, part of the General Programming Boards category; Ok i am trying to make a program that deletes only a specific location on a floppy disk.. but it ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,497
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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

    nvm i fixed it

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,497
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 01: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, 08:43 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21