Training, Open Source computer languages

PerlPHPPythonMySQLhttpd / TomcatTclRubyJavaC and C++LinuxCSS

Search our site for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Perl - functions for directory handling
Perl has many built in functions for file and directory handling and you should use them in preference to shelling out in your scripts because:

• They work across operating systems (at least as far as is practical)

• They are much more efficient as there's no extra processes being started and stopped all the time.

I've added a source code sample to our web site which shows some of these in use ...

cwd to find out where you are
chdir to change your current directory
-d to check is a symbol is a directory
opendir and readdir to read through a directory's content

Sample output:

earth-wind-and-fire:~ grahamellis$ perl chdirddemo
We are in /Users/grahamellis
We are now in /Users/grahamellis/jun07
Directory entry count: 24
We are now in /Users/grahamellis
Directory entry count: 390
earth-wind-and-fire:~ grahamellis$

(written 2007-06-09 07:48:09)

 
Associated topics are indexed under
P215 - Perl - More about Files
P602 - Perl - Advanced File and Directory Handling

Back to
Object Relation Mapping (ORM)
Previous and next
or
Horse's mouth home
Forward to
Melksham Art Cafe

Some other Articles
Where am I?
Some progress on the train campaign
Melksham businesses - networking together
Melksham Art Cafe
Perl - functions for directory handling
Object Relation Mapping (ORM)
Asda opening large new store in Melksham
Perl, the substitute operator s
Bathtubs and pecking birds
for loop - how it works (Perl, PHP, Java, C, etc)
1636 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

© WELL HOUSE CONSULTANTS LTD., 2008: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho