i need to write a program to move files from one folder to another how do I "cut and paste" in c
This is a discussion on simple code question within the C Programming forums, part of the General Programming Boards category; i need to write a program to move files from one folder to another how do I "cut and paste" ...
i need to write a program to move files from one folder to another how do I "cut and paste" in c
This sounds like a job for the OS. If you have to do it in C, have the OS do it with system() calls.
If you're bored, you can always read in a file, and write it out again somewhere else.
Or, if it's for Windows only, use MoveFile.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
can someone give me a quick sample code that uses movefile, I'm not sure on the syntax
... MoveFile("C:\\from\\here.txt", "C:\\to\\here.txt");
Seriously, doesn't get much easier![]()
thanx a bunch
should the code look like this
sry im a real noobCode:void main() { BOOL movefile("C:\\stuff","C:\\stuff2"); }
Last edited by potatopuff; 07-14-2008 at 08:15 PM.
it should be
int main(void) - read FAQ
BOOL has no meaning in this context
C is caseSensetive - so movefile and MoveFile are 2 different functions
If I have eight hours for cutting wood, I spend six sharpening my axe.