I treat the XAP file as a read-only filesystem today, which is why import works 
for files inside the XAP. In that case Directory.GetCurrentDirectory() "maybe" 
should give you the root of the XAP file, but I'm not sure how that would look. 
It would be interesting to see where the filesystem->XAP metaphor falls over.

Also, extending this metaphor to isolated storage is a better suited match. I'd 
like to support this first-class in Silverlight+DLR, so let me know if you want 
to write it =)

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:users-
> [EMAIL PROTECTED] On Behalf Of Michael Foord
> Sent: Tuesday, October 28, 2008 4:04 AM
> To: Discussion of IronPython
> Subject: Re: [IronPython] Current working directory in Silverlight?
>
> Kenneth Miller wrote:
> > All,
> >
> >
> >     Trying to execute this code in Silverlight:
> >
> > from System.IO import Directory
> > Directory.GetCurrentDirectory()
> >
>
> What happens when you execute this code?
>
> >     How do I handle directories in silveright? I know it's a bit
> > different since they're packaged. I need to be able to keep track of
> a
> > file's location inside the package.
>
> As you don't have a filesystem in Silverlight I doubt it has a concept
> of current working directory - this means that you will probably need
> to
> track it yourself. Being able to access resources inside the xap file
> using files is just a convenience.
>
> You can also use IsolatedStorage for filesystem like access in browser
> storage.
>
> Michael
>
> >
> > Thanks for your time.
> >
> > Regards,
> > Ken
> > _______________________________________________
> > Users mailing list
> > [email protected]
> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
> --
> http://www.ironpythoninaction.com/
> http://www.voidspace.org.uk/blog
>
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to