473,770 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with System::IO::Dir ectory::CreateD irectory()

I am receiving the following two errors in the code below. Both are
on Line 56.

error C2039: 'CreateDirector yA' : is not a member of
'System::IO::Di rectory'

error C2660: 'CreateDirector yA' : function does not take 1 arguments

Could anyone please point me in thr right direction?

Thanks!

----------------------------------------------------------
#include <windows.h>
#using <mscorlib.dll >
using namespace System;
using namespace System::IO;
#include "main.h"

int main() {

bool endlessLoop = true;

// Drive G: should be mapped to \\Dri-sql-mail2\G_share
String* strOldPath = "g:\\DRI\\scann er\\FinalPolici esTemp";
String* strNewPath =
"g:\\inetpub\\w wwroot\\Documen ts\\Completed Deeds & Docs";

// Program will run indefinitely
while(endlessLo op) {

// load a string array with a list of all of the
directories
String* strDirectoryEnt ries[] =
Directory::GetF ileSystemEntrie s(strOldPath);

// loop through that array and move each directory
for(int i=0;i<strDirect oryEntries->Length;i++) {

// The current time plus five minutes
DateTime dtNow = DateTime::Now;
dtNow = dtNow.AddMinute s(5.0);

// The time the file was last modified
DateTime dtThisFile =
File::GetLastWr iteTime(strDire ctoryEntries[i]);

// if the file's Last Modified time is greater
than the current time (plus 5 minutes)
// then we move the file.
if (DateTime::Comp are(dtNow, dtThisFile) >= 0)
{

// Grab the order number from the full
path.
String* strBeginningOfO rderNumber =
"\\";
String* strEndOfOrderNu mber = ".";
String* strOrderNumber =
strDirectoryEnt ries[i]->Substring(strD irectoryEntries[i]->LastIndexOf(st rBeginningOfOrd erNumber)+1,((s trDirectoryEntr ies[i]->Length)-(strDirectoryEn tries[i]->LastIndexOf(st rEndOfOrderNumb er)+1)));

// Grab the filename from the full
path.
String* strFileName =
String::Concat( strOrderNumber, ".tiff");

String* strTempNewPath =
String::Concat( strNewPath,"\\" );
strTempNewPath =
String::Concat( strTempNewPath, strOrderNumber) ;

// if the directory does NOT exist,
then create it
if(!Directory:: Exists(strTempN ewPath))
{
Directory::Crea teDirectory(str TempNewPath);
}

strTempNewPath =
String::Concat( strTempNewPath, "\\");
strTempNewPath =
String::Concat( strTempNewPath, strOrderNumber) ;

// move the file

File::Move(strD irectoryEntries[i],strTempNewPath );

}

Console::WriteL ine(String::Con cat(strDirector yEntries[i]," moved!"));
}
Console::WriteL ine("*** Do NOT close this Window!
***");

// Wait 3 minutes before next iteration
// 3m = 180s = 180,000ms
Sleep(180000);
}
return 0;
}
Jul 22 '05 #1
6 9265
Chad wrote:
I am receiving the following two errors in the code below. Both are
on Line 56.

error C2039: 'CreateDirector yA' : is not a member of
'System::IO::Di rectory'

error C2660: 'CreateDirector yA' : function does not take 1 arguments

Could anyone please point me in thr right direction?
Sure. Since your problem here platform specific (standard C++ knows
nothing of directories, etc.) asking in a MicroSoft forum (or checking
MSDN) would be appropriate.
Thanks!
You're welcome.

HTH,
--ag
----------------------------------------------------------
#include <windows.h>
#using <mscorlib.dll >
using namespace System;
using namespace System::IO;
#include "main.h"

int main() {

bool endlessLoop = true;

// Drive G: should be mapped to \\Dri-sql-mail2\G_share
String* strOldPath = "g:\\DRI\\scann er\\FinalPolici esTemp";
String* strNewPath =
"g:\\inetpub\\w wwroot\\Documen ts\\Completed Deeds & Docs";

// Program will run indefinitely
while(endlessLo op) {

// load a string array with a list of all of the
directories
String* strDirectoryEnt ries[] =
Directory::GetF ileSystemEntrie s(strOldPath);

// loop through that array and move each directory
for(int i=0;i<strDirect oryEntries->Length;i++) {

// The current time plus five minutes
DateTime dtNow = DateTime::Now;
dtNow = dtNow.AddMinute s(5.0);

// The time the file was last modified
DateTime dtThisFile =
File::GetLastWr iteTime(strDire ctoryEntries[i]);

// if the file's Last Modified time is greater
than the current time (plus 5 minutes)
// then we move the file.
if (DateTime::Comp are(dtNow, dtThisFile) >= 0)
{

// Grab the order number from the full
path.
String* strBeginningOfO rderNumber =
"\\";
String* strEndOfOrderNu mber = ".";
String* strOrderNumber =
strDirectoryEnt ries[i]->Substring(strD irectoryEntries[i]->LastIndexOf(st rBeginningOfOrd erNumber)+1,((s trDirectoryEntr ies[i]->Length)-(strDirectoryEn tries[i]->LastIndexOf(st rEndOfOrderNumb er)+1)));

// Grab the filename from the full
path.
String* strFileName =
String::Concat( strOrderNumber, ".tiff");

String* strTempNewPath =
String::Concat( strNewPath,"\\" );
strTempNewPath =
String::Concat( strTempNewPath, strOrderNumber) ;

// if the directory does NOT exist,
then create it
if(!Directory:: Exists(strTempN ewPath))
{
Directory::Crea teDirectory(str TempNewPath);
}

strTempNewPath =
String::Concat( strTempNewPath, "\\");
strTempNewPath =
String::Concat( strTempNewPath, strOrderNumber) ;

// move the file

File::Move(strD irectoryEntries[i],strTempNewPath );

}

Console::WriteL ine(String::Con cat(strDirector yEntries[i]," moved!"));
}
Console::WriteL ine("*** Do NOT close this Window!
***");

// Wait 3 minutes before next iteration
// 3m = 180s = 180,000ms
Sleep(180000);
}
return 0;
}

--
Artie Gold -- Austin, Texas
http://it-matters.blogspot.com (new post 12/5)
http://www.cafepress.com/goldsays
Jul 22 '05 #2
Chad wrote:
I am receiving the following two errors in the code below. Both are
on Line 56.

error C2039: 'CreateDirector yA' : is not a member of
'System::IO::Di rectory'

error C2660: 'CreateDirector yA' : function does not take 1 arguments

Could anyone please point me in thr right direction?


Yes:

--------> microsoft.publi c.*

Jonathan
Jul 22 '05 #3
On Mon, 17 Jan 2005 20:37:59 -0700, "Jonathan Turkanis"
<te******@kanga roologic.com> wrote:
Chad wrote:
I am receiving the following two errors in the code below. Both are
on Line 56.

error C2039: 'CreateDirector yA' : is not a member of
'System::IO::Di rectory'

error C2660: 'CreateDirector yA' : function does not take 1 arguments

Could anyone please point me in thr right direction?


Yes:

--------> microsoft.publi c.*

Jonathan

I hear an echo... :)
Jul 22 '05 #4
On Mon, 17 Jan 2005 21:24:23 -0600, Artie Gold
<ar*******@aust in.rr.com> wrote in comp.lang.c++:
Chad wrote:
I am receiving the following two errors in the code below. Both are
on Line 56.

error C2039: 'CreateDirector yA' : is not a member of
'System::IO::Di rectory'

error C2660: 'CreateDirector yA' : function does not take 1 arguments

Could anyone please point me in thr right direction?


Sure. Since your problem here platform specific (standard C++ knows
nothing of directories, etc.) asking in a MicroSoft forum (or checking
MSDN) would be appropriate.

Thanks!


You're welcome.

HTH,
--ag


[snip]

And snipping the remaining 92 lines of off-topic code would be
appropriate as well.

--
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.l earn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 22 '05 #5
Jack Klein wrote:
On Mon, 17 Jan 2005 21:24:23 -0600, Artie Gold
<ar*******@aust in.rr.com> wrote in comp.lang.c++:

Chad wrote:
I am receiving the following two errors in the code below. Both are
on Line 56.

error C2039: 'CreateDirector yA' : is not a member of
'System::IO: :Directory'
[snip]
Sure. Since your problem here platform specific (standard C++ knows
nothing of directories, etc.) asking in a MicroSoft forum (or checking
MSDN) would be appropriate.
Thanks!


You're welcome.

[snip]

And snipping the remaining 92 lines of off-topic code would be
appropriate as well.

Mea cul...

--ag

--
Artie Gold -- Austin, Texas
http://it-matters.blogspot.com (new post 12/5)
http://www.cafepress.com/goldsays
Jul 22 '05 #6
On Mon, 17 Jan 2005 20:54:31 -0600, Chad <ch********@gma il.com> wrote:
I am receiving the following two errors in the code below. Both are
on Line 56.

error C2039: 'CreateDirector yA' : is not a member of
'System::IO::D irectory'

error C2660: 'CreateDirector yA' : function does not take 1 arguments

Could anyone please point me in thr right direction?

Thanks!

----------------------------------------------------------
#include <windows.h>
#using <mscorlib.dll >
using namespace System;
using namespace System::IO;
#include "main.h"

<snip>
I fixed the problem by adding #undef CreateDirectory immediately after
#include <windows.h>

- Chad
Jul 22 '05 #7

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

Similar topics

7
5272
by: Eran Kampf | last post by:
I am trying to dynamically create directories in my ASP.NET application (I am using Server.MapPath("/")+"test" as the folder) and I am getting a DirectoryNotFoundException saying "Could not find a part of the path "D:\". My site is hosted on a public ISP that for obvious security reasons does not allow my read access above my wwwroot folder which seems to be a problem when trying to create directories... Is there any way to solve this?
1
1538
by: H.B. | last post by:
Hi, Is there a way to avoid conflicts between CreateDirectory() (from API) and Directory::CreateDirectory(). The other functions from Directory class works(Exists() as example). It seems to be caused by the inclusion of "windows.h" ... but I need it. I already tried the System::IO::Directory::CreateDirectory() typo. Any ideas ?
5
5145
by: Philip Wagenaar | last post by:
I have a Windows Form application that monitors a directory using the System.IO.FileSystemWatcher. On the event created I run a sub that sends an xml file over http to a service. When I copy 7000 files in the directory to be monitored only 123 are sent to the service. What might be going wrong?
0
2199
by: NewbieDev | last post by:
Hi, I call Directory.CreateDirectory and File.Copy from VB.NET with a UNC path that has a dollar sign ($) - "\\servername\foldername$\childfoldername\" and it gives me this error message: System.IO.DirectoryNotFoundException - Could not find a part of the path "\\servername\foldername$" Do I need to have an absolute path and not a relative path, which the dollar
2
1217
by: mr t | last post by:
I have a website set up this way... http://localhost <- project root. http://localhost/Files <- vir dir (not application. just vir dir) with write permissions. 1. Start VS.NET 2005 debugging. (must be vs.net 2005, not 2003) 2. Using code, System.IO.Directory.CreateDirectory a sub dir inside / Files, something like, /Files/Images 3. Stop debugging.
0
1491
by: Matt MacDonald | last post by:
Hi all, I'm having a really frustrating problem. I have a web application that needs to modify the directory structure of the underlying files. The problem I'm having is that after the system creates a sub-directory in an existing directory, and then I try to move the parent directory, I get an access denied error. I've tried setting the resultant directory object to nothing after creating it, among other things. I also tried running...
4
2573
by: Tom | last post by:
This is really weird, but I have the following code: private static readonly string mString = "tempUnzipDir" + Path.DirectorySeparatorChar; .... public static string ExtractToTempLocation(string aZip) { try
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8933
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2850
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.