473,480 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Creating Folders In Visual C++

TJK
I'm trying to create a Folder using Visual C++ in the Visual Studio
..NET environment. So far I haven't found a successful of doing this.

The folder is to be created using a name given by the user via scanf
or cin. After this I want to be able to use fprintf to create several
files in the folder. I can write the files but don't know how to
create the folder and have the files written in the folder.

Thank you for any help you can give me

TJK

PS I'm still quite new to programming so please forgive me for when I
miss the seemingly obvious :)
Jul 22 '05 #1
5 4053
TJK wrote:
I'm trying to create a Folder using Visual C++ in the Visual Studio
.NET environment. So far I haven't found a successful of doing this.

The folder is to be created using a name given by the user via scanf
or cin. After this I want to be able to use fprintf to create several
files in the folder. I can write the files but don't know how to
create the folder and have the files written in the folder.

Thank you for any help you can give me

TJK

PS I'm still quite new to programming so please forgive me for when I
miss the seemingly obvious :)


Since folders are outside the domain of the C++ language, you should
consult the experts in a Visual C++ newsgroup.

Hint: Folders are also known as directories and many operating
systems treat them similar to files.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 22 '05 #2
There is no C/C++ function to create/manage/navigate directories (folders) that
I'm aware of.

There is the stdlib system() call that will execute a command through the
command interpreter, but the actual command text will have to be platform
specific.

If you are targeting Windows, then you should ask your question in a more
appropriate newsgroup and you will get some platform-specific ways to do what
you want. Check your news server under microsoft.public.*.

TJK wrote:

I'm trying to create a Folder using Visual C++ in the Visual Studio
.NET environment. So far I haven't found a successful of doing this.

The folder is to be created using a name given by the user via scanf
or cin. After this I want to be able to use fprintf to create several
files in the folder. I can write the files but don't know how to
create the folder and have the files written in the folder.

Thank you for any help you can give me

TJK

PS I'm still quite new to programming so please forgive me for when I
miss the seemingly obvious :)

Jul 22 '05 #3
On 2 Mar 2004 07:44:19 -0800, TJK <ki**************@hotmail.com> wrote:
I'm trying to create a Folder using Visual C++ in the Visual Studio
.NET environment. So far I haven't found a successful of doing this.

The folder is to be created using a name given by the user via scanf
or cin. After this I want to be able to use fprintf to create several
files in the folder. I can write the files but don't know how to
create the folder and have the files written in the folder.

Thank you for any help you can give me

TJK

PS I'm still quite new to programming so please forgive me for when I
miss the seemingly obvious :)


I'm sure you've been told a few times now that this is off topic but here
it is:

#include <windows.h>

int main()
{
int returnValue = 0; //int variable initialized to zero

returnValue = CreateDirectory("c:\\mydirectory", NULL);

return 0;
}

NOTE: CreateDirectory returns a non zero number if succesfull.
You can call GetLastError()
if you need for more info. ALSO: notice the double \\ in c:\\mydirectory. You can do it
that way or c:/mydirectory. The second parameter is security settings for the new directory.
See MSDN for more info on that but NULL just gives it default settings.

Michael Edukonis
Jul 22 '05 #4
On Tue, 02 Mar 2004 18:18:01 -0600, "Edukonis, Michael J."
<me*******@tech-broker.com> wrote in comp.lang.c++:
On 2 Mar 2004 07:44:19 -0800, TJK <ki**************@hotmail.com> wrote:
I'm trying to create a Folder using Visual C++ in the Visual Studio
.NET environment. So far I haven't found a successful of doing this.

The folder is to be created using a name given by the user via scanf
or cin. After this I want to be able to use fprintf to create several
files in the folder. I can write the files but don't know how to
create the folder and have the files written in the folder.

Thank you for any help you can give me

TJK

PS I'm still quite new to programming so please forgive me for when I
miss the seemingly obvious :)


I'm sure you've been told a few times now that this is off topic but here
it is:

#include <windows.h>


And they were right. windows.h and each and every single thing in it,
and each and every thing in the nested includes it contains, all half
a megabyte or so (last I looked) is 100% off-topic here.

Please don't pollute comp.lang.c++ with off-topic nonsense.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 22 '05 #5
boost::filesystem is a rather elegant solution.
http://www.boost.org/libs/filesystem/doc/index.htm

ki**************@hotmail.com (TJK) wrote in message news:<9d**************************@posting.google. com>...
I'm trying to create a Folder using Visual C++ in the Visual Studio
.NET environment. So far I haven't found a successful of doing this.

The folder is to be created using a name given by the user via scanf
or cin. After this I want to be able to use fprintf to create several
files in the folder. I can write the files but don't know how to
create the folder and have the files written in the folder.

Thank you for any help you can give me

TJK

PS I'm still quite new to programming so please forgive me for when I
miss the seemingly obvious :)

Jul 22 '05 #6

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

Similar topics

1
1646
by: Richard Johansson | last post by:
Hi, I want to create an option for creating shortcuts to my application on the users desktop and Start menu in the setup. In my deployment project i have created the necessary checkboxes, and...
1
1267
by: gemel | last post by:
Some of the folders in Visual Studio projects are fairly deeply nested and this causes me a problem when I want to go to the VS Command Prompt to use utilities such as ILDASM and CSC with the...
2
1500
by: umilmi81 | last post by:
I am having a problem creating an ASP.NET application in Visual Studio.NET 2003, installed on Windows XP Professional I get a message stating that I do not have ASP.NET 1.1 installed, so I can not...
3
2247
by: Dave | last post by:
I have an old Visual Studio 2001 VB ASP.Net application; really all I have are the folders and files from the web server. How can I "hook" this back up to Visual Studio 2003 so I can update it? ...
1
1829
by: dave | last post by:
Hello: In Visual Studio 6.0 there is "VisData" to create Access database files. (file.MDB". Q: Does Visual Studio 2005 have tool(s) that create Access database files (file.MDB) ? thank...
2
2918
by: Quido | last post by:
I am using Visual Studio 2005 If I go to: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vbwlkCreatingDistributedWebApplicationWalkthrough.asp It says: To...
0
2089
by: =?Utf-8?B?TGlhbSBNYWM=?= | last post by:
Hi Folks, I have embeded WMI scripting within a Visual Basic application to create remote shares and set permissions, I'm now moving to vb.net environment and having trouble getting my scripting...
1
1287
by: Mick Walker | last post by:
Hi all, I am wondering is it possible to create a physical Directory such as "C:\Test" using the DirectoryServices namespace. If so, does anyone have any resources on how to do it? I should...
0
1394
by: samz | last post by:
Hello, Here is a simple PHP recursive file list (with interactive and visual FX) Sam's Files http://acc.jexiste.ch/JPN/RecurciveDIR12.RAR 1. How to ignore/avoid empty folders in this PHP script...
0
6904
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
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6886
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...
0
5324
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4768
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4472
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.