Archived

This topic is now archived and is closed to further replies.

Programmer One

System Calls

Recommended Posts

Programmer One    746
I want to use a system call to copy files from one place to another, but everytime I try, I get a error (not the compiler) saying that it cannot find the file. So, how do I copy a file using system calls? I am trying this:
  
system("copy A:\\EmergencyBackup\\SysBak.dat C:\\SysUtil\\Loaders\\SysBak.dat /y");
  
_____________________________________________________ ICQ #: 149510932 Google - OpenGL - DirectX - Windows Guide Network - MSDN - Symantec Virus Info "Imagination is more important than knowledge." - Albert Einstein

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Is it really important that you do it with a system call?

Perhaps you could lose the double slashes or the second time you mention the file name or the /y?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Could also be your trying to move the file to a directory that does not exist. I don''t think it will automatically create the directory for you, but I could be mistaken.

Share this post


Link to post
Share on other sites
DrPizza    160
''copy'' is not a program, it is a cmd/command/4NT/etc. built-in.

This isn''t a "system call"; a system call would be typically achieved by pushing some values onto the stack and emitting a particular interrupt, or perhaps by using the sysenter x86 instruction.

Share this post


Link to post
Share on other sites