I won''t defend Perl syntax. I hate it.
I will point out the Perl/Python/etc. have built-in functions for directory (et al.) routines to abstract away these platform-dependent operations.
Cross-platform scripting
quote: Original post by RomSteady
That being said, even though you can use Perl or Python as a scripting language on multiple platforms, remember that each platform has a seperate command set. Passing "ls -l" to a Windows box (unless you have a set of *nix-compatible tools installed) will generally not work.
That''s why you would use os.listdir( ''.'' ) instead. The Python library is so vast that there is very rarely a need to call out to native commands.
"I know very well who Satan is: He is freedom. He is the uncontrolled, the incalculable, the antithesis of order and discipline, the antithesis of the legalism of outer space.... We know where a planet will be in twelve years, four months and nine days. But we don''t know where a butterfly will have flown one minute hence. Therefore the butterfly is of Satan."
-- Jens Bjørneboe
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement