|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
I've been trying to do some stuff like copying files and changing attributes of files using C++.
However, there's a irritating command window which pops up and goes away in a split second whenever I use system(command). For example: Code:
system("copy .\\test.exe /B C:\\test.exe /B");
For copying of files, I can probably use the manual method of copying using file manipulation in binary mode, but I do not know other alternatives for changing attributes of files. So, can you guys offer me a solution? Is there another function in C++ that changes attributes of files, or is there a way to stop the command window from popping up? Thanks in advance! ![]() |
| Sponsored Links |
|
|
|
|||||
|
Nope, I believe you will need to read the contents of the file and then write them to the destination file manually in order to copy a file with out the command prompt showing. If you are using .NET you can use the file.copy function.
__________________
CodeCall Blog | CodeCall Wiki | Shareware Site | Linux Forum | Write a Blog Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall |
|
|||
|
Ya, i can do that for copying, but I also need to change attributes.
I'm not using .NET. My compiler is Dev-C++. You guys know any better free ones for windows? I can't afford .NET, just a poor high school student here. |
|
|||||
|
.NET is free. Maybe you misunderstand what it is:
@ You write programs in C++ .NET, perhaps using Microsoft's Visual Studio 2008 Express Editions (available free from Visual Studio 2008 Express Editions). @ You compile the programs as .NET programs and distribute them. @ When the user runs it, they must have the .NET Framework installed (also free). .NET is not a compiler - it is a framework. In other words, when the program runs, it relies on the framework to run it. The framework provides lots of really helpful classes, such as System.IO.File, which can do everything with files, and really easily, too. The compiler used, from Visual Studio 2008 Express Editions, is both free and comprehensive. Give it a try! Oh, and I know what you mean - I'm 12 years old. |
|
|||
|
Oh, ok, i get what .NET is.
Anyway, I found the functions I need in WIN32 API already. So, for a .NET program, it requires the user to have the platform too, isn't it quite troublesome? What benefits does it have over WIN32 API or other default libraries? |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|