LinuxQuestions.org
Visit Jeremy's Blog.
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 04-12-2006, 12:48 PM   #1
anoosh
LQ Newbie
 
Registered: Aug 2004
Location: IRAN
Posts: 7

Rep: Reputation: 0
rename a file


hello.
how may I rename a file for example test.dat in C?
thanks
 
Old 04-12-2006, 12:52 PM   #2
pdeman2
Member
 
Registered: Jul 2005
Location: Maine, USA
Distribution: OpenSUSE, Gentoo, Fedora, Ubuntu, Mandriva, others
Posts: 413

Rep: Reputation: 30
If the program is for linux, you can just set it up to use the rename command. I believe the rename command uses:
Code:
rename old.name new.name old.name
 
Old 04-12-2006, 02:10 PM   #3
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Take a look at the source code of mv.c
 
Old 04-12-2006, 02:15 PM   #4
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
man 2 rename
 
  


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
Multiple File Rename windisch Linux - General 11 11-10-2005 12:19 PM
How can i Rename file? Khmer Linux - Newbie 4 10-21-2005 08:09 AM
Can't rename file with parenthesis in name pleasehelp Linux - Newbie 4 03-16-2004 03:01 PM
How do I rename a file? Thaidog Linux - Newbie 5 10-10-2003 10:28 PM
How to rename a file? juanb Linux - General 4 03-19-2003 11:20 AM

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

All times are GMT -5. The time now is 04:19 PM.

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
Open Source Consulting | Domain Registration