Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Import files on accessible URL and save in

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122784] Re: Import files on accessible URL and save in
  • From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
  • Date: Thu, 10 Nov 2011 06:54:31 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201111050945.EAA10302@smc.vnet.net>

Hi Todd,

I rechecked the situation and I have to admit that you are right. It's
not FetchURLs fault and the files created can be deleted.
This package-installer of mine is a java-jar which is used to extract
the zipped contents of my Mathematica-package into its
destination-folder. To do this, I load the jar into the classpath and
call the methods through JLink. My last two lines of the install
function are

	ReinstallJava[];
	Quiet[DeleteFile[{installer, newTVPackage}]];

Here, I was clearly wrong since I thought that ReinstallJava[] works
instantly and loses the connection to the "installer" jar file. After
guessing around, I found that this works:

	UninstallJava[];
	Pause[1];
	InstallJava[];
	DeleteFile[{installer, newTVPackage}];

Question: Is there a right way, when I really want to uninstall a
jar-file from the classpath I used with JLink?

Question: Is there any better possibility to extract the contents of a
gzip|zip|tar|tgz into an arbitrary folder? I tried really hard to find
this functionality inside Import but I failed and had to write my own
java-classes doing this.

Cheers
Patrick

On Wed, 2011-11-09 at 12:31 -0600, Todd Gayley wrote:
> At 09:59 AM 11/9/2011, Patrick Scheibe wrote:
> >Hi,
> >
> >I have written a small application which uses FetchURL to download and
> >install a Mathematica-package of mine from within Mathematica and
> >without external tools like wget, tar, ..
> >
> >There, I came across this behaviour too. On windows, and only on
> >windows, I was not able to remove my temporary "package installer"
> >although I closed every used file.
> >
> >When I remeber right, I could remove it *after* killing the kernel which
> >is a bit useless if you want to download, install and remove temp. stuff
> >in one function call and leave the user with a fresh installed new
> >package.
> 
> 
> Patrick,
> 
> I think your inability to delete the file is caused by what you are 
> doing with the file after the download. You should be able to delete 
> files created by FetchURL:
> 
>     DeleteFile[FetchURL["some url"]]
> 
> 
> Todd Gayley
> Wolfram Research
> 





  • Prev by Date: Re: proportional vs monospace font in usage text
  • Next by Date: Re: proportional vs monospace font in usage text
  • Previous by thread: Re: Import files on accessible URL and save in
  • Next by thread: Re: Import files on accessible URL and save in