Jump to content
  • Advertisement

Archived

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

Programmer One

System Calls

This topic is 5968 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
Advertisement
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
My guess is that the file couldn''t be found in the A: drive, or the target directory doesn''t exist.

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!