473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Accessing directories and sub-directories.

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 1506
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
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...
0
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...
11
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
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...
5
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
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...
2
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:...
1
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"...
1
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...
0
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
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,...
0
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...
0
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...
0
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...

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.