473,802 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing directories and sub-directories.

8 New Member
Hi
I am very new to perl.I want to write a script which will access the directories and their sub-directories.For eg.

-default
----main
-------dir1
----------
------------
----------

----------
-----------
-----------x
-------dir2
-----------
-------dir3
------------folder1
----------sub1
-----------y
------------folder2
----------sub2
-----------z

Now for the above folder structure I want a script that will take me to the last directory (x,y,z in the above case) .Everytime the script goes to the last folder it must generate the path followed .
eg.default/main/dir3/folder1/sub1/y
This generated path has then got to be passed on to an external file as a variable.
What I make out here is that I need
1) conditional loop - condition is:Are there any more folders(not individual files) inside the current folder?If Yes ,go to 2). If No ,go to 3).
2) open the folder .go to 1).
3) generate the absolute path. where , $path = absolute path
4) external file uses $path
5) end
Oct 4 '06 #1
1 1520
homesick123
8 New Member
actually this is the folder structure

-default
----main
-------dir1
###### ----------(sub folder of dir1)
------------
###### ----------

###### ----------
########### -----------
############### ### -----------x
-------dir2
###### -----------(sub folder of dir2)
-------dir3
------------folder1
###### ----------sub1
############### ##-----------y(sub folder of sub1)
------------folder2
###### ----------sub2
############## -----------z
Oct 4 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2631
by: damonf | last post by:
I'm currently trying to add an ASP hyperlink to a template column in a datagrid. The normal hyperlink column doesn't give me the ability to add attributes to the item. In my grid there are four columns. Three are databound to a dataset and one is a template column. I need to be able to access each item in the template column (getting access to the hyperlink) then adding an attribute to call some client side code. Does anyone know...
0
1579
by: N. Demos | last post by:
Hello, I'm having problems accessing a complex XML child node (latitude & longitude), and passing it to a function when the XML file has been read into a DataSet. Specifically, the returned object from accessing the 'latitude' and 'longitude' nodes is not a DataTable (as specified in the MSDN). I'm not sure what type is being returned, nor how to go about finding out. Any pointers would be appreciated. Below is the relevent Error message,...
11
1362
by: alex | last post by:
Hi, how can I access / set properties of controls in other forms. i.e. mdi parent of mdi child mdi child of mdi child mdi child of mdi parent Thanks Alex
1
1837
by: tmaster | last post by:
Within a class, can I create a property that is a listview? Here's what I tried, but it doesn't seem to work: '------------ create property to give the second form access to the first form's listview: Public Class frmToDoDetail ' (this is the second form)
5
1949
by: RSH | last post by:
I havent been able to set a property from another class with out getting some sort of error. Can someone please tell me what I'm doing wrong here? Public Class Form1
4
3642
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if possible.. for example..i hav a menu in the parent form named "Administrator" whic has an item "mnuLogIn"..now when i click on login..another child form named "frmLogIn" is displayed..what i want to happen is this: when login form(frmLogIn) is...
2
2134
by: GCM | last post by:
I have a database which was created from another parent database by combining some fields into one field for clerification purposes. When I create a for with the following command I get this error: Error accessing file. Network connection may have been lost. Following is the function I use. Eveything else works fine. This function worked on the parent database. The form data is linked to the proper table: ...
1
2104
by: Dave | last post by:
I have the following ASP.NET 2.0 code (simplified here for ease): <asp:Repeater id="SearchResultsRepeater" runat="server"> <ItemTemplate> <uc:SearchResult ID="SearchResult" ResultObject="<%#Container.DataItem%>" runat="server"> <ButtonsTemplate> <uc:ViewButton ID="ViewButton" ListingReference='<%#Eval("ListingReference")%>' runat="server" /> </ButtonsTemplate>
1
1231
by: priyamtheone | last post by:
Hi friends, I have got two problems while accessing cd drives. FIRSTLY: I want a code example of how to detect whether the cd drive of my machine is opened or closed. SECONDLY: I'm trying to open or close the cd drive of my machine. It's working properly if there's only one cd drive. But wut if there r more than one. The code I'm using is accessing the default cd drive only. Below is the code I'm using: 'In the general declarations:...
0
2033
by: Roger Stoller | last post by:
Hello. I have developed a COM object using ATL. It seems to work fine when accessing it from VB.NET most of the time. However, I want to use a delegate in VB to asynchronously run a method in one of the interfaces in my COM module (using Delegate.BeginInvoke()). The interface seems to be "junk" when accessing it from the delegated VB method. When called synchronously from the same thread using the Delegate.Invoke(), it seems to work...
0
9562
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
10305
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...
0
10063
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6838
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
5494
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
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
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
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
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.