Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-10-2009, 03:53 PM
|
#1
|
|
Member
Registered: Sep 2009
Posts: 31
Rep:
|
Where can i get the source code of rm command
I just need to develop a new command for deleting a file in LINUX Character mode , same like as windows instead of deleting the file , it should move to a folder name trash .
I just started reading the source code of coreutil , need to write a code for the new command "delete".
Am a MS student with BITS , want to do my dessertation in this , can anyone help me out .
|
|
|
|
09-10-2009, 04:10 PM
|
#2
|
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 3,971
|
rm is part of coreutils, so you are lookin in the correct place. You answered your own question so...
|
|
|
|
09-10-2009, 04:15 PM
|
#3
|
|
Member
Registered: Aug 2009
Location: Brazil
Distribution: Ubuntu Lucid
Posts: 45
Rep:
|
I'm a C++ developer and i use like this:
Code:
// Remove.cpp
#include <iostream>
int main() {
remove("test.txt");
return 0;
}
But this is a very simple code, we can add if structures and some other things!
But, you have experience in which languages?
|
|
|
|
09-10-2009, 04:17 PM
|
#4
|
|
Member
Registered: Aug 2009
Location: Brazil
Distribution: Ubuntu Lucid
Posts: 45
Rep:
|
If you want to delete directorys here is a very nice snippet that i love, it's simple and objective: http://www.dreamincode.net/code/snippet2700.htm
Hope i'm Helping!
|
|
|
|
09-11-2009, 05:22 PM
|
#5
|
|
Member
Registered: Sep 2009
Posts: 31
Original Poster
Rep:
|
Hi all thanks , but i need to study the code for commands rm & mv , so that i can try to develop a new command "delete" ,as while deleting a file a zipped copy of the file is moving to a marked location.
Can any one get me the actual code for the commands...
|
|
|
|
09-11-2009, 05:26 PM
|
#6
|
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 3,971
|
You are really going to have a hard time to do this if you can't even figure that out...
Code:
$ tar xf /var/portage/distfiles/coreutils-7.5.tar.gz
$ cd coreutils-7.5/
$ ls src/rm*
src/rm.c src/rmdir.c
$ ls src/mv*
src/mv.c
The names of the files are evident enough. If you truly have looked into the source of coreutils (I think you didn't) it's very hard to miss these, the names of the files are self-explanatory.
|
|
|
|
09-19-2009, 12:04 AM
|
#7
|
|
Member
Registered: Sep 2009
Posts: 31
Original Poster
Rep:
|
Thanks , From coreutil/src/rm & coreutils/src/mv i have started learning the codes for rm & mv .
hope after studying i can edit the code in such a way once giving the rm command the marking file will dump to a destination folder.
Please let us know apart from this coreutil/src/rm & coreutils/src/mv what are all the supporting files that i should check and edit while applying this to kernel.
If any one aware of these script ,please let us know how to edit this rm script what are the supporting scripts for this.....
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:54 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|