473,396 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

renaming an open file using c++

hello every one ,
i want to open a file and then do some processing on it and finally
change its name or append something to its name and then save it
back .
can anyone please help!

and also i have to open all the files with a set of
extensions( .txt,.doc etc) files in a directory using only the
extensions as the actual name of the files is not available ..can that
be done ????

thank you
mohan
Jun 27 '08 #1
3 1762
mohi wrote:
hello every one ,
i want to open a file and then do some processing on it and finally
change its name or append something to its name and then save it
back .
can anyone please help!

and also i have to open all the files with a set of
extensions( .txt,.doc etc) files in a directory using only the
extensions as the actual name of the files is not available ..can that
be done ????
Not with standard C++ libraries. Most compilers provide
system-specific libraries to do those things. You didn't mention your
system so I can't be of more help.
Jun 27 '08 #2
On Tue, 22 Apr 2008 02:36:08 -0700, mohi wrote:
hello every one ,
i want to open a file and then do some processing on it and finally
change its name or append something to its name and then save it
back .
can anyone please help!

and also i have to open all the files with a set of
extensions( .txt,.doc etc) files in a directory using only the
extensions as the actual name of the files is not available ..can that
be done ????

thank you
mohan
I did reply you, in case you missed that, did you have a look at the boost
filesystem library, for linux it is perfect and you can do most of what
you have written. copying with a new name, rename , removing etc.

Rgds,

--
Umut
Jun 27 '08 #3
On Tue, 22 Apr 2008 02:36:08 -0700, mohi wrote:
hello every one ,
i want to open a file and then do some processing on it and finally
change its name or append something to its name and then save it
back .
can anyone please help!

and also i have to open all the files with a set of
extensions( .txt,.doc etc) files in a directory using only the
extensions as the actual name of the files is not available ..can that
be done ????

thank you
mohan
Here are some links, see the 2nd

http://www.boost.org/doc/libs/1_35_0.../doc/index.htm

http://beans.seartipy.com/2006/05/10...he-filesystem/

HTH
--
Umut
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Don Leverton | last post by:
Hi Folks, I have been given a CD with approx 130 .xls files (bean-counters!) that I would like to import and merge to ONE table (tblTradeshow). The XL files are *similarly*, but not...
6
by: Pegboy | last post by:
I am trying to create a DOS utility that will extract data from a file and use it to form a new filename for that same file. I can successfully open the file, get the data I need and form the new...
0
by: Jan van Schalkwyk | last post by:
Hi, I'm using System.IO.File.Move(OLDname, NEWname) to rename a file (I'm not moving it to a new folder). If the folder containing the file is open in the file explorer, the Move fails with...
0
by: Andy | last post by:
Hello: I am using System.Web.Mail.MailMessage. Currently: when I am attaching a file to the object, I am renaming the file using the FileInfo.Copy method and attaching the new file to the...
8
by: BillCo | last post by:
I'm updating a legacy app with table naming that makes baby jesus cry. It's a bit of a spider web though... no telling when and where the tables will be called by name. So I wrote this for renaming...
11
by: Steven D'Aprano | last post by:
I want to rename a file, but only if the destination file name doesn't already exist. I can do this: if os.path.exists(dest): # skip file, raise an exception, make a backup......
5
by: bulldog8 | last post by:
I've read numerous posts and have tried multiple approaches that I found, but just cannot get a file renamed. I am using VB.Net 2002 ... Here is what I have tried: 1) Code common to all...
1
by: GeoDW | last post by:
Hell All, I have looked around and not found the solution I am looking for within the old threads. Here is my problem: I have a directory full of .img and .rrd files that have long filenames...
2
by: aaron.watters | last post by:
Hi. I'm writing an archival system which I'd like to be portable to Windows. The system relies on the property of Unix which allows a process to keep a file open even if another process renames...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.