.NETGURU
System IO Directory.create
Messages   Related Types
This message was discovered on ASPFriends.com 'ngfx-io' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Carlos Magalhaes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2652.35">
<TITLE>System IO Directory.create</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Hi all,</FONT>
</P>

<P><FONT SIZE=2>I a web app I am trying to do the following:</FONT>
</P>
<BR>

<P><FONT SIZE=2>Dim Jobid as string</FONT>
<BR><FONT SIZE=2>Jobid = "123"</FONT>
</P>

<P><FONT SIZE=2>System.IO.Directory.CreateDirectory("\\Myserver\goup4.1! flowerd\dumper & Jobid & "")</FONT>
</P>

<P><FONT SIZE=2>When I try run it I receive an error:</FONT>
</P>

<P><FONT SIZE=2>System.IO.DirectoryNotFoundException: Could not find a part of the path "\\Myserver\goup4.1! flowerd\".</FONT>
</P>

<P><FONT SIZE=2>It totally misses out the last part "\dumper"</FONT>
</P>

<P><FONT SIZE=2>If I go to start run and go to "\\Myserver\goup4.1! flowerd\" It goes there with out any problems.</FONT>
</P>

<P><FONT SIZE=2>I don't understand why it says it cant find it ......</FONT>
</P>

<P><FONT SIZE=2>Can anyone explain maybe is it the file name with the "." And the ! in it?</FONT>
</P>

<P><FONT SIZE=2>I don't know but I do need some expert advise here!</FONT>
</P>

<P><FONT SIZE=2>Thanks </FONT>
</P>

<P><FONT SIZE=2>Carlos</FONT>
</P>

<P><FONT SIZE=2>p.s. I even tried mapping a drive e.g.</FONT>
</P>

<P><FONT SIZE=2>mapped drive t:\ = \\Myserver\goup4.1! flowerd\dumper </FONT>
</P>

<P><FONT SIZE=2>But then it says cant find part of location?????</FONT>
</P>

</BODY>
</HTML>

-------------------------------------------------------------
This email and any files transmitted are
confidential and intended solely for the
use of the individual or entity to which
they are addressed, whose privacy
should be respected. Any views or
opinions are solely those of the author
and do not necessarily represent those
of the Trencor Group, or any of its
representatives, unless specifically
stated.

Email transmission cannot be guaranteed
to be secure, error free or without virus
contamination. The sender therefore
accepts no liability for any errors or
omissions in the contents of this message,
nor for any virus infection that might result
from opening this message. Trencor is not
responsible in the event of any third party
interception of this email.

If you have received this email in error please notify
Click here to reveal e-mail address For more information about
Trencor, visit www.trencor.net <http://www.trencor.net>

Reply to this message...
 
    
ToddC@match.com
System.IO.Directory.CreateDirectory("\\Myserver\goup4.1! flowerd\dumper" &
Jobid & "")
Try creating a variable to create the string in, then trace the variable to
see what you are actually sending to the CreateDirectory method.
tc

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Wednesday, May 22, 2002 5:56 AM
To: ngfx-io
Subject: [ngfx-io] System IO Directory.create

Hi all,
I a web app I am trying to do the following:

Dim Jobid as string
Jobid = "123"
System.IO.Directory.CreateDirectory("\\Myserver\goup4.1! flowerd\dumper &
Jobid & "")
When I try run it I receive an error:
System.IO.DirectoryNotFoundException: Could not find a part of the path
"\\Myserver\goup4.1! flowerd\".
It totally misses out the last part "\dumper"
If I go to start run and go to "\\Myserver\goup4.1! flowerd\" It goes there
with out any problems.
I don't understand why it says it cant find it ......
Can anyone explain maybe is it the file name with the "." And the ! in it?
I don't know but I do need some expert advise here!
Thanks
Carlos
p.s. I even tried mapping a drive e.g.
mapped drive t:\ = \\Myserver\goup4.1! flowerd\dumper
But then it says cant find part of location?????
| [ngfx-io] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT
------------------------------------------------------------- This email and
any files transmitted are confidential and intended solely for the use of
the individual or entity to which they are addressed, whose privacy should
be respected. Any views or opinions are solely those of the author and do
not necessarily represent those of the Trencor Group, or any of its
representatives, unless specifically stated. Email transmission cannot be
guaranteed to be secure, error free or without virus contamination. The
sender therefore accepts no liability for any errors or omissions in the
contents of this message, nor for any virus infection that might result from
opening this message. Trencor is not responsible in the event of any third
party interception of this email. If you have received this email in error
please notify Click here to reveal e-mail address For more information about Trencor,
visit www.trencor.net
Reply to this message...
 
    
Carlos Magalhaes
That's EXACTLY what I have done and for some reason its doing the following:

("\\Myserver\ \dumper" & Jobid & "")

Instead of ("\\Myserver\goup4.1! flowerd\dumper" & Jobid & "")

I even changed the dir name to ("\\Myserver\ flowerd\dumper" & Jobid & "")

To make things simpler but then it leaves flowerd out???????

And ideas why?

-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]
Sent: Wednesday, May 22, 2002 8:05 PM
To: ngfx-io
Subject: [ngfx-io] RE: System IO Directory.create

System.IO.Directory.CreateDirectory("\\Myserver\goup4.1! flowerd\dumper" &
Jobid & "")

Try creating a variable to create the string in, then trace the variable to
see what you are actually sending to the CreateDirectory method.

tc

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Wednesday, May 22, 2002 5:56 AM
To: ngfx-io
Subject: [ngfx-io] System IO Directory.create

Hi all,

I a web app I am trying to do the following:

Dim Jobid as string
Jobid = "123"

System.IO.Directory.CreateDirectory("\\Myserver\goup4.1! flowerd\dumper &
Jobid & "")

When I try run it I receive an error:

System.IO.DirectoryNotFoundException: Could not find a part of the path
"\\Myserver\goup4.1! flowerd\".

It totally misses out the last part "\dumper"

If I go to start run and go to "\\Myserver\goup4.1! flowerd\" It goes there
with out any problems.

I don't understand why it says it cant find it ......

Can anyone explain maybe is it the file name with the "." And the ! in it?

I don't know but I do need some expert advise here!

Thanks

Carlos

p.s. I even tried mapping a drive e.g.

mapped drive t:\ = \\Myserver\goup4.1! flowerd\dumper

But then it says cant find part of location?????

| [ngfx-io] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT

| [ngfx-io] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT

------------------------------------------------------------- This email and
any files transmitted are confidential and intended solely for the use of
the individual or entity to which they are addressed, whose privacy should
be respected. Any views or opinions are solely those of the author and do
not necessarily represent those of the Trencor Group, or any of its
representatives, unless specifically stated. Email transmission cannot be
guaranteed to be secure, error free or without virus contamination. The
sender therefore accepts no liability for any errors or omissions in the
contents of this message, nor for any virus infection that might result from
opening this message. Trencor is not responsible in the event of any third
party interception of this email. If you have received this email in error
please notify Click here to reveal e-mail address For more information about Trencor,
visit www.trencor.net

-------------------------------------------------------------
This email and any files transmitted are
confidential and intended solely for the
use of the individual or entity to which
they are addressed, whose privacy
should be respected. Any views or
opinions are solely those of the author
and do not necessarily represent those
of the Trencor Group, or any of its
representatives, unless specifically
stated.

Email transmission cannot be guaranteed
to be secure, error free or without virus
contamination. The sender therefore
accepts no liability for any errors or
omissions in the contents of this message,
nor for any virus infection that might result
from opening this message. Trencor is not
responsible in the event of any third party
interception of this email.

If you have received this email in error please notify
Click here to reveal e-mail address For more information about
Trencor, visit www.trencor.net <http://www.trencor.net>
Reply to this message...
 
    
Mitch Denny (VIP)
Carlos,

A good neat way of working with strings that I have found is
using the Format method on the System.String class, in this
case you can use a simple substitution method:

    Dim newDirectory As String

    newDirectory = String.Format("\\SERVER\SHARE\DIRECTORY\{0}",
JobId)

    Directory.Create(newDirectory)

This string substitution method is exactly the same as the
one used on the Console.WriteLine(...) method so it should
be fairly familiar to you. For a fairly quick overview of
the power of using formatting in your code I suggest a
look at the following SDK documentation:

    
ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpconformattingoverview.htm

Hope this helps.

----------------------------------------
- Mitch Denny
- Click here to reveal e-mail address
- +61 (414) 610-141
-

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Thursday, 23 May 2002 04:13
To: ngfx-io
Cc: Click here to reveal e-mail address
Subject: [ngfx-io] RE: System IO Directory.create

That's EXACTLY what I have done and for some reason its doing the
following:

("\\Myserver\ \dumper" & Jobid & "")

Instead of ("\\Myserver\goup4.1! flowerd\dumper" & Jobid & "")

I even changed the dir name to ("\\Myserver\ flowerd\dumper" & Jobid &
"")

To make things simpler but then it leaves flowerd out???????

And ideas why?

-----Original Message-----
From: Click here to reveal e-mail address [mailto:Click here to reveal e-mail address]
Sent: Wednesday, May 22, 2002 8:05 PM
To: ngfx-io
Subject: [ngfx-io] RE: System IO Directory.create

System.IO.Directory.CreateDirectory("\\Myserver\goup4.1! flowerd\dumper"
& Jobid & "")

Try creating a variable to create the string in, then trace the variable
to see what you are actually sending to the CreateDirectory method.

tc

-----Original Message-----
From: Carlos Magalhaes [mailto:Click here to reveal e-mail address]
Sent: Wednesday, May 22, 2002 5:56 AM
To: ngfx-io
Subject: [ngfx-io] System IO Directory.create

Hi all,

I a web app I am trying to do the following:

Dim Jobid as string
Jobid = "123"

System.IO.Directory.CreateDirectory("\\Myserver\goup4.1! flowerd\dumper
& Jobid & "")

When I try run it I receive an error:

System.IO.DirectoryNotFoundException: Could not find a part of the path
"\\Myserver\goup4.1! flowerd\".

It totally misses out the last part "\dumper"

If I go to start run and go to "\\Myserver\goup4.1! flowerd\" It goes
there with out any problems.

I don't understand why it says it cant find it ......

Can anyone explain maybe is it the file name with the "." And the ! in
it?

I don't know but I do need some expert advise here!

Thanks

Carlos

p.s. I even tried mapping a drive e.g.

mapped drive t:\ = \\Myserver\goup4.1! flowerd\dumper

But then it says cant find part of location?????

| [ngfx-io] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT

| [ngfx-io] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/ngfx-io.asp = JOIN/QUIT

------------------------------------------------------------- This email
and any files transmitted are confidential and intended solely for the
use of the individual or entity to which they are addressed, whose
privacy should be respected. Any views or opinions are solely those of
the author and do not necessarily represent those of the Trencor Group,
or any of its representatives, unless specifically stated. Email
transmission cannot be guaranteed to be secure, error free or without
virus contamination. The sender therefore accepts no liability for any
errors or omissions in the contents of this message, nor for any virus
infection that might result from opening this message. Trencor is not
responsible in the event of any third party interception of this email.
If you have received this email in error please notify
Click here to reveal e-mail address For more information about Trencor, visit
www.trencor.net

-------------------------------------------------------------
This email and any files transmitted are
confidential and intended solely for the
use of the individual or entity to which
they are addressed, whose privacy
should be respected. Any views or
opinions are solely those of the author
and do not necessarily represent those
of the Trencor Group, or any of its
representatives, unless specifically
stated.

Email transmission cannot be guaranteed
to be secure, error free or without virus
contamination. The sender therefore
accepts no liability for any errors or
omissions in the contents of this message,
nor for any virus infection that might result
from opening this message. Trencor is not
responsible in the event of any third party
interception of this email.

If you have received this email in error please notify
Click here to reveal e-mail address For more information about
Trencor, visit www.trencor.net <http://www.trencor.net>

Reply to this message...
 
    
Shawn Doucet
I've encountered a simular problem. I believe that the problem is with folder permissions rather than any sort of pathing problem. I have an app that checks for the existance of a folder and if it is not there creates it. When trying to write to the newly created folder I recieve the 'Could not find a part of the path' error. If I manually change the folder permissions to Full Control / Everyone and then rerun the app the error doesn't occur. I haven't quite figured out how to access write permissions of the newly created folder, but when I do I'll post it here.

--------------------------------
From: Shawn Doucet
Reply to this message...
 
 
System.Console
System.IO.Directory
System.IO.DirectoryNotFoundException
System.String




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification