remove file using UNIX on C 
Author Message
 remove file using UNIX on C

Hi,

I am new to C and would like to ask for help.

Problem:

I have a function that  return a string and I want to rename
a file in a directory with a return string.

Example:

A function return a string "New_file"
I would like rename a file in a directory with new name call "New_file"

What I have in mine is to use the Unix command:

system ("mv "old_file" "New_file");

Would someone show me how to implement this in C.

Thanks in advance,

--== Sent via Deja.com http://www.*-*-*.com/
---Share what you know. Learn what you don't.---



Tue, 30 Oct 2001 03:00:00 GMT  
 remove file using UNIX on C

comp.lang.c:

Quote:
> Hi,

> I am new to C and would like to ask for help.

> Problem:

> I have a function that  return a string and I want to rename
> a file in a directory with a return string.

> Example:

> A function return a string "New_file"
> I would like rename a file in a directory with new name call "New_file"

> What I have in mine is to use the Unix command:

> system ("mv "old_file" "New_file");

> Would someone show me how to implement this in C.

> Thanks in advance,

<Jack>

Look at the standard library function rename() prototyped in
<stdio.h>.

</Jack>
--
Do not email me with questions about programming.
Post them to the appropriate newsgroup.
Followups to my posts are welcome.



Tue, 30 Oct 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Newbie: separate big .cs file into small .cs files

2. Two CS files (using namespaces)

3. Check the file size and number symbols in a file using C in Unix

4. resx files needed for cs - files ??

5. CS files display in VS6 like CPP files ?

6. Questions on Unix File/Directory Manipulation using C

7. Help on file write() on Unix using C ...

8. Precompiled header-files on Unix using Make ?

9. Applying file masks in UNIX using C/C++

10. Bug using UNIX file types

11. Compile CS source code using ICodeCompiler

12. Survey on using C as intro CS langauge (?)

 

 
Powered by phpBB® Forum Software