Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Is There a C Code Snippet to Rename
Name: Tina Brant Date: February 12, 2004 at 12:52:57 Pacific OS: windows98 CPU/Ram: 64k
Comment:
Can anyone tell me if there is a code snippet in 'C' that will rename a file? So far my program will prompt the user for the existing file name; and then prompt the user for the new file name. I just don't know how to actually make it happen.
Is there a way to use the unix renaming command inside of a C program?
Name: Electric Mayhem Date: February 12, 2004 at 14:26:43 Pacific
Reply:
Just a shot in the dark: System( )
Why do I say shot in the dark? I'm not a programmer. I have written 1 program a while back for compressing multiple files individually. Since doing it in a DOS like environment is easiest, I used System( ) to perform the compression on each file. Go to www.programmersheaven.com or .net and try to find more information about it there.
HTH!
0
Response Number 2
Name: Electric Mayhem Date: February 12, 2004 at 14:45:53 Pacific
Reply:
Quote: "u can use System, or you can use the API.. creat() read() write() Buffer your info and then write it back out. Look at the man pages for those, and you should find what u need.. it'll be done by the kernel for you. :-)"
- From one of the nice programmers on my Buddy list.
0
Response Number 3
Name: fpmurphy Date: February 13, 2004 at 07:43:30 Pacific
Reply:
Use the POSIX/SUS API rename(2). man 2 rename will display the details.
- F
0
Response Number 4
Name: Tina Brant Date: February 13, 2004 at 09:28:11 Pacific
Reply:
Thank you all for your comments & suggestions. I appreciate your help. I am off to investigate... :)
Summary: Is there a C shell command (or script anyone knows of) that will return the IP number of the system? I cannot assume access to 'nslookup'. ...
Summary: Hi, I am wroking in C program that deals with system file in windows. The content of the file is refreshed when the user click on the icon/folder that contains the file OR when opening and closing the...
Summary: Hi, I have this problem: I work in a Unix network (running on HP Unix) with several pc terminals that are emulating, and each terminal has a printer. Each printer is attached to the network through a ...