i need to write a program to move files from one folder to another how do I "cut and paste" in c
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
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler