473,666 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FileSystem Object - Iterating through a directory and building the path

Hi all ..

I have a directory with several subdirectories and a number of files in
each.
These files are accessed by going to a web page and clicking in a listbox
and navigating to the desired file.

Currently, when a new file is added to one of the sub directories, a new
link must be added to the web
page to add the new file to the listbox ... yes .... a very manually
intensive process!

I believe that I can replace this existing process with a dynamic one using
the File System Object but I could
use a little help thinking it through.

I need to display the file name (without the extention) in the listbox and I
need to build the path to the
file to be used as the Option Value in the listbox.

i.e.
<Option
value=file://servername/directory/subdirectory/subdirectory/subdirectory/fil
ename

I need two loops ... looping through the Folder Collection and through the
File collection. Do I nest them?
And how do I capture the path as it's building?

Thanks for any help and any direction !
- lise
Jul 19 '05 #1
1 5390
"Lise" <sc*******@snet .net> wrote in message
news:Ox******** ******@TK2MSFTN GP09.phx.gbl...
I believe that I can replace this existing process with a dynamic one using the File System Object but I could
use a little help thinking it through.

I need to display the file name (without the extention) in the listbox and I need to build the path to the
file to be used as the Option Value in the listbox.

i.e.
<Option
value=file://servername/directory/subdirectory/subdirectory/subdirectory/fil ename

I need two loops ... looping through the Folder Collection and through the
File collection. Do I nest them?
And how do I capture the path as it's building?


First, make sure you surround the option value with double quotes. As in:
<option value="...">

Next, you will probably want a function to handle the iteration, since you
want this to be dynamic. This function should take 1 or 2 parameters, the
path of the folder and perhaps a string to accumulate the filenames. This
function should create a FileSystemObjec t, then GetFolder of the path that
was passed in. Next, get the SubFolders. For Each subfolder in
foldercollectio n
' call the function again
Next
' Append the files in this folder to the input string (or print them if you
don't pass the string)

I wish I had time to go into more detail, but this is as much help as I can
be for now. Gotta run. Hope this helps some.
Regards,
Peter Foti


Jul 19 '05 #2

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

Similar topics

9
5804
by: Peter Hansen | last post by:
The term "mock filesystem" refers to code allowing unit or acceptance tests to create, read and write, and manipulate in other ways "virtual" files, without any actual disk access. Everything is held in memory and therefore fast, without risk of damaging real files, and with none of the messiness of leftover files after testing. Googling the archives and the web suggests that only I and Remy Blank have done much along these lines. I...
2
3332
by: stuart | last post by:
Hi, I am trying to access remote directories using the filesystemobject and ASP. This only seems to work when the security is set to anonymous. However, I want to connect to the remote server and pass through the users credentials rather than the "connect as" anonymous credentials. The web server is 2003 and running IIS6. Thanks for your help
11
9243
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
2
2081
by: Matthias | last post by:
Hi, I am currently writing a gtkmm component which acts as a file browser, much like a small filemanager which can be embedded in gtkmm applications as a scrolled window. I have just rewritten the component to use the boost::filesystem classes instead of the C functions for interacting with the filesystem. However I am getting a strange error when I start my app: When iterating
4
7108
by: Ben Fidge | last post by:
Hi What is the most efficient way to gather a list of files under a given folder recursively with the ability to specify exclusion file masks? For example, say I wanted to get a list of all files under \Program Files and it's subdirectories that meet the following criteria:
8
2987
by: Daz | last post by:
Hi Everyone. I am sturggling trying to find out a way in which I can delete a 'path' object. I may not need to delete it, however, I need to overwrite it. The function I am trying to code, converts a string into a 'path' object, then checks to see if it exists. If it doesn't exist, the path object needs to be reused and the new path string put into it (not appended to it). If anyone could help, or point out where I can find this...
5
3418
by: GaryE | last post by:
Hello: I am having trouble linking a couple of files using the boost::filesystem. I am using MSVC 6.0. Here is an abbreviated version of my problem: foo.h: #ifndef __FOO_ #define __FOO_ #include "boost/filesystem.hpp"
2
4576
by: Javier | last post by:
Hello all, I'm trying to remove a hidden file (in UNIX) using the Boost::filesystem library. This is what I have: #include <boost/filesystem/operations.hpp> namespace fs=boost::filesystem;
1
4216
by: mfsiddiq | last post by:
HI i am trying to connect my java client to Microsoft active directoy using secure ssl,but when i try enable ssl support i get the following error but it works fine with apache studio,which is a ldap browser and i am able to view the ldap tree.But when i use the same configuration with my java client the following exception is thrown 0:03:19,296 ERROR crowd.console.action.principal.BrowsePrincipals: Unable to communicate with LDAP server;...
0
8352
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
8863
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
7378
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...
0
5661
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
4192
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4358
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
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 we have to send another system
2
2005
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1763
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.