W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2009

Unzipping content into current directory widely considered poor practice

From: Dan Brickley <danbri@danbri.org>
Date: Fri, 20 Nov 2009 09:48:35 +0100
Message-ID: <eb19f3360911200048nc0aab91j4a8fa364ce180b8a@mail.gmail.com>
To: public-webapps WG <public-webapps@w3.org>

I understand from http://www.w3.org/TR/2009/WD-widgets-20091029/ that
this is the place to direct my feedback on the widget packaging spec,
and that I have missed the Last Call deadline by one day. I hope you
will consider my plea anyway, since it is based on evaluation of an
implementation I only discovered last night. See below for an issue I
tried to raise with the implementor.

It seems W3C Widget zip packages unload a mess of several files in the
current working directory when unzipped.

This is unfortunate and I urge you to consider a design that allows
things to be kept in a single subdirectory.

1. the dominant convention in modern software development is that you
can safely unwrap a .zip or .tar.gz in the current working directory,
in the expectation that you'll find only a sensibly named
subdirectory. Those who violate this expectation are often seen as
making a basic beginners mistake. Encoding such a 'mistake' in a W3C
REC both looks bad, and encourages bad practice.

2. by risking a mixup between pre-existing files and those from the
archive file, we introduce the risk of confusion and inclarity, making
widgets ever slightly harder to learn from. And or those who do try to
learn from others works, we reward them by making a mess of their
filetree. Assuming 1000 new developers decide each day to explore W3C
Widget technology and learn by example, I expect 900+ of them will
come with the reasonable assumption that a zip file can be safely
unpacked in a directory that has already got other stuff in it
(including possibly files with common names like index.html). Mixing
up files will be annoying; accidentally overwriting files will be

3. Are we confident that all unzip tools will ask nicely before
overwriting existing files? A quick test on my machine at least gave
me a warning.

TellyClub:~ danbri$ mkdir w3ctest
TellyClub:~ danbri$ cd w3ctest/
TellyClub:w3ctest danbri$ echo '<html6>my original valuable html
document</>' > index.html
TellyClub:w3ctest danbri$ curl -Os http://berjon.com/tmp/a-widget.wgt
TellyClub:w3ctest danbri$ unzip a-widget.wgt
Archive:  a-widget.wgt
  inflating: config.xml
  inflating: icon.svg
   creating: img/
  inflating: img/me.jpg
replace index.html? [y]es, [n]o, [A]ll, [N]one, [r]ename:

Thanks for considering my request.



---------- Forwarded message ----------
From:  <widgeon@googlecode.com>
Date: Fri, Nov 20, 2009 at 9:24 AM
Subject: Re: Issue 4 in widgeon: test widget unzips in current directory
To: danbrickley@gmail.com

       Status: Invalid

Comment #1 on issue 4 by robin.berjon: test widget unzips in current directory

That is something that is imposed on us by the Widgets spec, so you'd have to
complain to Marcos I'm afraid.

You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
Received on Friday, 20 November 2009 08:49:08 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:21 UTC