Archived

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

System Calls

This topic is 5750 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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
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
''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