Thread: Making a folder and moving files into it?

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    8

    Question Making a folder and moving files into it?

    Hi guys

    I am looking to make a small program in C that asks for the name you would like to call your folder then creates that folder in the same directory as the program is in, then it asks you for the name of the file you would like to move into that folder, the file due for moving will also bee in the same directory as the program.

    I have only learnt how to make a text file so far not how to make a folder and also I dont know how to move files. Please could somebody point me in the right direction.
    I have googled it before coming here but all I get is C# code

    Cheers

    HLA91

  2. #2
    Beautiful to C Aia's Avatar
    Join Date
    Jun 2007
    Posts
    124
    Since you use the word folder I am going to assume your operating system is some MS Windows.
    Take a look at the functions CreateDirectory() and CopyFile()
    Here's an example of how both functions are used. Look in the code for those two functions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems Moving Certain Folders...
    By notsocks in forum C Programming
    Replies: 8
    Last Post: 12-16-2007, 07:25 AM
  2. moving files
    By warney_out in forum C Programming
    Replies: 1
    Last Post: 08-23-2005, 08:06 AM
  3. Moving files from one directory to multiple dirs
    By csj561 in forum C Programming
    Replies: 7
    Last Post: 03-18-2005, 03:52 PM
  4. Continuously moving files with windows commands
    By deltabird in forum Windows Programming
    Replies: 4
    Last Post: 04-18-2003, 10:59 AM
  5. Moving Files
    By Kyoto Oshiro in forum C++ Programming
    Replies: 2
    Last Post: 09-04-2002, 07:24 PM