LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-23-2005, 05:52 AM   #1
pantera
Member
 
Registered: May 2004
Posts: 80

Rep: Reputation: 15
moving files


i have two querries
1.how can i use C commands(not "mv" command) to cut and paste a file from one folder to another....
2.and also how can i do cut,copy and paste text in text box
i am using linux
 
Old 08-23-2005, 06:28 AM   #2
F0ul_Olli
Member
 
Registered: Aug 2005
Location: Flintshire, WALES, UK
Distribution: Slackware
Posts: 57

Rep: Reputation: 15
My C is a little rusty, but there was a command which allowed you to use a local command (a linux command on a Linux box, but the program wouldn't work on a windows box)

e.g. sys(mv file)


Your bet bet is to ask at a c forum - http://cboard.cprogramming.com/
 
Old 08-23-2005, 06:58 AM   #3
decates
LQ Newbie
 
Registered: Jan 2003
Location: UK
Distribution: Gentoo
Posts: 14

Rep: Reputation: 0
If you have the filenames in strings (or can put them in strings), you can create a string containing the entire command you want to run, for example "mv /path1/file1 /path2/file2" and then use the 'system' function to execute the command, for example: system(commandstring)

Try 'man system' in a terminal to view the details of the system command (and note that it needs you to include stdlib.h).

As for text in a textbox, I assume you are still talking about programming (if not, my apologies), and that is a completely different matter. I think it depends on what graphical API you use with your program (for example GTK, Qt,...) and I don't know of any easy way to move text to/from what I assume is a console-based program other than using Ctrl-Shift-c and Ctrl-Shift-v to actually copy and paste text to/from the terminal window.

Hope that helps.

Last edited by decates; 08-23-2005 at 07:10 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving files Pyrophorus Slackware 5 11-09-2005 11:47 AM
Moving files UmneyDurak Fedora 4 08-28-2005 06:52 PM
Moving Files arockia Linare 3 09-08-2004 09:14 AM
Moving Files jhotchkiss Linux - Newbie 5 09-16-2003 04:41 PM
Moving files into an archive gkep Linux - Newbie 2 07-27-2003 10:42 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration