Thread: Quick Question

  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-26-2005, 11:05 PM
  2. very quick question.
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 07-24-2002, 03:48 AM
  3. quick question
    By Unregistered in forum C++ Programming
    Replies: 5
    Last Post: 07-22-2002, 04:44 AM
  4. Quick Question Regarding Pointers
    By charash in forum C++ Programming
    Replies: 4
    Last Post: 05-04-2002, 11:04 AM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM