ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
cooldude.c: In function `int main()':
copy.c:3: error: `Dekstop' undeclared (first use this function)
copy.c:3: error: (Each undeclared identifier is reported only once for each
function it appears in.)
copy.c:3: error: `what3' undeclared (first use this function)
copy.c:3:49: missing terminating " character
copy.c:4: error: parse error before string constant
Can somebody "translate" this to me? What should I do?
You are missing a closing quote for your first parameter
Are you sure you want to copy from the Desktop folder to Dekstop? Looks like a typo there
Because the ~ expansion is a bash thing, i don't think your C program is going to expand that to /home/username for you. You may need to supply a full path.
Edit: It also appears you are trying to use the Win32 CopyFile function. That's not in the standard C/C++ library. Since you are using Linux, it's not even in one of the typical Linux libraries. You can however, probably install the Wine libraries and use those. (Although, if the only Win32 function you want to use is CopyFile, there are probably better ways to do it than using Winelib just for that...)
It also appears you are trying to use the Win32 CopyFile function. That's not in the standard C/C++ library. Since you are using Linux, it's not even in one of the typical Linux libraries. You can however, probably install the Wine libraries and use those. (Although, if the only Win32 function you want to use is CopyFile, there are probably better ways to do it than using Winelib just for that...)
Distribution: LFS, I felt the itch and scratched it
Posts: 227
Rep:
The cp command is the easiest way to copy a file.
If you want to copy a file through a C program, you could either do it manually by opening it up, reading, and then writing it out to another file or use the system function:
system("cp ~/Desktop/what.txt ~/Dekstop/what3.txt");
Originally posted by igor@44 I wanted to make file that can copy itself into ~/.kde/Autostart . How can I do that?
Well, if you really want a file to copy itself (you still have to execute it, though):
Code:
#!/bin/more +2 ~/.kde/Autostart
Put the wanted
file contents in the rest of the
file, make it executable with
chmod a+x thisfile'sname
and then execute it
will copy all but the first line into ~/.kde/Autostart. I'm not sure this is really what you mean, though, is it?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.