Skip to content

Tag: c++

Copy a file from one directory to another in C++

I am writing a C++ program to copy one file from one directory to another. I don’t want to use C++ 17 features. I have already implemented this in the following code. I am on Linux and I want to use the OS cp command to do this. I have written this code. The error is: cp: source: No such

Share Memory in Linux using C

Is it safe to use shm_unlink even there are other process currently open the shared memory? For exmaple: Process B shm_open and then Process A shm_unlink. Is it ok for Process B? Answer Yes, it is safe to call shm_unlink if another process has it opened. Per the man page for shm_unlink: The operation of shm_u…