platform stuff

Wilson, Doug Doug_Wilson at intuit.com
Mon Aug 13 14:25:37 CDT 2001


~sdpm~
I meant to reply to the list, but just replied to cabney so here
goes again :)

Let me also add that if I'm writing something that I know will
only be on Windows or Unix, then I'll just use forward slashes.

If I'm going to put it on CPAN, then I'll use File::Spec. (I just
wish other authors would do the same). I can't be sure that it'll
work on Mac or VMS or whatever, but at least it'll be easier to
fix if it doesn't :)

~sdpm~
> I'm writing a module that will probably be used on different 
> OS platforms.
> 
> I'm wondering if things like directory delimiters and PATH delimiters
> are going to be an issue.

On windows, forward slashes are transparently converted to backslashes in
directory paths. So most filenames should be compatible between Windows and
Unix (unless you include the Windows drive or network system name (e.g.
'C:\' or '\\SOMESYSTEM', but even then forward slashes are ok
on windows). But if you really want to be portable (Mac, VMS, etc),
you might want to use File::Spec. (See File::Spec and File::Spec::Unix to
start,
then the other File::Spec::* modules if you're curious about how other
systems
do it).

HTH
-Doug
~sdpm~

The posting address is: san-diego-pm-list at hfb.pm.org

List requests should be sent to: majordomo at hfb.pm.org

If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at happyfunball.pm.org> with the following
command in the body of your email message:

    unsubscribe san-diego-pm-list

If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at happyfunball.pm.org> .
This is the general rule for most mailing lists when you need
to contact a human.




More information about the San-Diego-pm mailing list