Quick Question

This is a discussion on Quick Question within the C++ Programming forums, part of the General Programming Boards category; Okay, I have some questions, first off.....how can I copy, rename, and delete files...and also, can someone tell me why ...

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    6

    Quick Question

    Okay, I have some questions, first off.....how can I copy, rename, and delete files...and also, can someone tell me why this won't work:

    int bleh(char TheDrive[0])
    {
    char SetupDrive[8];
    SetupDrive=TheDrive[0]+:\windows\Thisfile;

    if(access(SetupDrive, 00))
    {
    return 1;
    }
    else
    {
    return 0;
    }
    }


    thanks a lot!

  2. #2
    Unregistered
    Guest
    The reason this will not work

    int bleh(char TheDrive[0])
    {
    char SetupDrive[8];
    SetupDrive=TheDrive[0]+:\windows\Thisfile;
    //Change to
    char SetUpDrive[255] = "";


    SetUpDrive[0] = TheDrive[0];
    SetUpDrive[1] = '\0';
    strcat(SetUpDrive, "\\windows\\ThisFile.txt");




    thanks a lot!

  3. #3
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    It's a lot easier to just use the unix style folder names, which work fine.

    int bleh(char TheDrive[0])
    {
    char SetupDrive[8];
    SetupDrive=TheDrive[0]+:\windows\Thisfile;
    //Change to
    char SetUpDrive[255] = "";


    SetUpDrive[0] = TheDrive[0];
    SetUpDrive[1] = '\0';
    strcat(SetUpDrive, "/windows/ThisFile.txt");
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  4. #4
    Registered User
    Join Date
    Jan 2002
    Posts
    6
    ahh, thank you!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Very quick math question
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 10-27-2005, 12:05 AM
  2. very quick question.
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 07-24-2002, 04:48 AM
  3. quick question
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2002, 05:44 AM
  4. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 12:04 PM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 06:46 PM

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