Hi.
When I use CreateFolder() to create a folder with a space at the end,
it creates the folder successfully, but still errors out with a "Path
not Found" error.
For example:
<%
Dim strCurrentPath
strCurrentPath = "c:\test folder \
If Not oFO.FolderExists(strCurrentPath) Then
oFO.CreateFolder(strCurrentPath) 'Errors on this line.
End If
%>
After the folder is created, it cannot be deleted or renamed
immediately. I think there still must be some process attached. The
error when trying to delete it is: "Cannot delete file: Cannot read
from the source file or disk."
I need to be able to leave the space in for now.
Any ideas on why this occurs?
Thanks! 10 1684
Just as a follow on, I can get around this by adding "on error" around
the createFolder(), but I'd rather get to the bottom of the error.
Here is an example of something I would do:
<%
Dim strCurrentPath
Dim strErrNum, strErrMessage
strCurrentPath = "c:\test folder \
If Not oFO.FolderExists(strCurrentPath) Then
On Error Resume Next
oFO.CreateFolder(strCurrentPath)
If Not oFO.FolderExists(strCurrentPath) Then
strErrNum = Err.number
strErrMessage = Err.Description
End If
On Error GoTo 0
If Len(strErrMessage) > 0 Then
Err.Raise strErrNum, "CreateFolder(), strErrMessage
End If
End If
%>
After some investigation, it appears that if you leave off the trailing
"\" on the path, the folder gets created successfully with no error,
and the trailing space gets stripped off.
Unfortunately, with FileExists() if you are looking for "c:\test
\folder\test.txt" it won't strip and it won't match.
On a brigher note (slightly) this is taken care of in asp.net with all
trailing spaces removed on exists() and createfolder() with or without
the final "\".
I cant see why you would want to create a folder with a space at the end?
"anjelone" <an******@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com... After some investigation, it appears that if you leave off the trailing "\" on the path, the folder gets created successfully with no error, and the trailing space gets stripped off.
Unfortunately, with FileExists() if you are looking for "c:\test \folder\test.txt" it won't strip and it won't match.
On a brigher note (slightly) this is taken care of in asp.net with all trailing spaces removed on exists() and createfolder() with or without the final "\".
We use user input project names to create folders and then reference
those project names to read from those folders. This is a legacy aspect
of the system that will definitely change, but it is so integrated at
this point that it needs to stay for the time being.
I'm hoping it will be converted to a better system in the next 2
months, but the show must go on until then.
Anyway, it is interesting to see the inconsistencies and I can't be the
first to be bitten by it...
I still don't understand
Why cant you just use Trim(folderName) to get rid of the space?
"anjelone" <an******@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com... We use user input project names to create folders and then reference those project names to read from those folders. This is a legacy aspect of the system that will definitely change, but it is so integrated at this point that it needs to stay for the time being.
I'm hoping it will be converted to a better system in the next 2 months, but the show must go on until then.
Anyway, it is interesting to see the inconsistencies and I can't be the first to be bitten by it...
When beginning development, you are correct. Just use Trim or something
similar.
*Code written w/o vars for ease.
So I:
CreateFolder(TRIM("c:\test "))
Then I want to put another folder in that first one from a different
section of the site at a different time:
CreateFolder(TRIM("c:\test \test2 "))
Ooops!
I trimmed the first CreateFolder so now when creating the second I have
to trim both...
CreateFolder(TRIM("c:\test ") + TRIM("\test2 "))
And what happens when I use FileExists or FolderExists? Same
thing....Trim's on everything.
In my case I would have to add that in approximately 200 files of code,
multiple times in some of them.
For a set of code used in 16 seperate production sites, that is a lot
of changing and a whole lot of testing.
Not to mention that file uploading, downloading and manipulation are
integral to our product so if something went wrong with that it would
be a major issue.
Again, "I'm hoping it will be converted to a better system in the next
2 months, but the show must go on until then."
Plus, I'm not condoning this "trailing space" practice in any way, mind
you, it is simply the code I'm dealing with. You must understand the
position of walking into old badly developed code and having to deal
until you can correct it...
"anjelone" <an******@gmail.com> wrote in message
news:11*********************@t31g2000cwb.googlegro ups.com... When beginning development, you are correct. Just use Trim or something similar.
*Code written w/o vars for ease. So I: CreateFolder(TRIM("c:\test ")) Then I want to put another folder in that first one from a different section of the site at a different time: CreateFolder(TRIM("c:\test \test2 "))
Ooops! I trimmed the first CreateFolder so now when creating the second I have to trim both... CreateFolder(TRIM("c:\test ") + TRIM("\test2 "))
And what happens when I use FileExists or FolderExists? Same thing....Trim's on everything.
In my case I would have to add that in approximately 200 files of code, multiple times in some of them. For a set of code used in 16 seperate production sites, that is a lot of changing and a whole lot of testing.
where are the stored?
lop though them
using the 1 line of code including trim?
Not to mention that file uploading, downloading and manipulation are integral to our product so if something went wrong with that it would be a major issue.
Again, "I'm hoping it will be converted to a better system in the next 2 months, but the show must go on until then."
Plus, I'm not condoning this "trailing space" practice in any way, mind you, it is simply the code I'm dealing with. You must understand the position of walking into old badly developed code and having to deal until you can correct it...
Folder names are project names, task names, contract names, review
names, location names and report names that users input. All files
associated with all those things go into the folder named for that
thing.
"anjelone" <an******@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com... Folder names are project names, task names, contract names, review names, location names and report names that users input. All files associated with all those things go into the folder named for that thing.
I'm mean in a programming sense, you must have them in a database or a array
or something,
there for you only have to use Trim once and loop though your collection
The users still have the ability in a bunch of places to hand enter the
names so that it all gets messed up again.
And we pull from other datasources where there also have been trailing
spaces.
Its quite a mess really. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Suresh |
last post by:
CreateFolder method does not produce a result from IIS. I
tried many things including changing file permissions, web
server permissions etc. to no avail. Can you please help?
|
by: AndrewM |
last post by:
Hello everyone,
I have an asp page with a create folder script
fs.CreateFolder(path)
When running this on the server I get a Permission denied message as the
IUSER account has no write...
|
by: Bren |
last post by:
In the code below I'm trying to create a directory. It works on the
production server, but it doesn't on my dev server; I'm running XP Pro, but
I don't belong to a domain; I'm running it in a...
|
by: Skeptical |
last post by:
Greetings,
This question is related to Microsoft Reporting Services Web service. I
tried asking it in RS groups but no one seems to be knowledgeable enough to
answer, so I wanted to try my...
|
by: deko |
last post by:
I use this convention frequently:
Exit_Here:
Exit Sub
HandleErr:
Select Case Err.Number
Case 3163
Resume Next
Case 3376
Resume Next
| |
by: p |
last post by:
WE had a Crystal 8 WebApp using vs 2002 which we upgraded to VS2003. I also
have Crystal 9 pro on my development machine. The web app runs fine on my
dev machine but am having problems deploying....
|
by: Steve |
last post by:
Hi all,
I am referring to this article in MSDN :
http://msdn.microsoft.com/library/en-us/secauthn/security/logonuser.asp
While creating folder on the remote machine, we are specifying the UNC...
|
by: Ali Chambers |
last post by:
Hi,
I have created a listbox called "dtlist1" on my VB.NET form. I call a
procedure as follows:
Private Sub openfile(flname As String)
dtlist1.Items.Clear()
etc..
|
by: RdS |
last post by:
Hello,
I have been searching for what createfolder can return or does return.
Where on MSDN can I find what a MS method returns? I have searched for
filesystemobject.createfolder errors, error...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
| |
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...
|
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: 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,...
|
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...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |