Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #19998

Re: A proposal to handle file encodings

From "Peter J. Holzer" <hjp-usenet2@hjp.at>
Newsgroups comp.lang.java.programmer
Subject Re: A proposal to handle file encodings
Date 2012-11-27 19:51 +0100
Organization LUGA
Message-ID <slrnkba2tp.k8a.hjp-usenet2@hrunkner.hjp.at> (permalink)
References (2 earlier) <k8mrjv$5l6$1@dont-email.me> <jd1ua8h786rv5qrm2ejtt5kge0jeh0c7kr@4ax.com> <k8qqev$ehi$1@localhost.localdomain> <slrnkb3ojp.qr8.hjp-usenet2@hrunkner.hjp.at> <k8tmlj$6jr$3@localhost.localdomain>

Show all headers | View raw


On 2012-11-25 18:05, Martin Gregorie <martin@address-in-sig.invalid> wrote:
> On Sun, 25 Nov 2012 10:18:49 +0100, Peter J. Holzer wrote:
>> File attributes have existed on ext* filesystems for a very long time.
>>
> Yes, but only pretty basic ones.

They are arbitrary key/value pairs. You can put any information there,
there is no restriction to "basic" information (whatever that might be).
They are limited to a single block (typically 4kB), though, so MIME
type, character set, keywords, etc. are ok, but a thumbnail image might
be problematic.

> Here we're talking about hypothetically storing stuff like character
> encoding

This one is even somewhat standardized: user.charset is documented on
http://www.freedesktop.org/wiki/CommonExtendedAttributes which probably
means that some GUI programs are actually using it (besides the Apache
module where it originated).

To return to the topic of this group: Is there a Java library for
setting and retrieving xattrs?


>> There is no file copy operation on the OS level. The kernel just sees
>> that a process is creating and writing a new file. It doesn't know
>> whether this process intends this new file to be an identical copy of
>> some other file.
>>
> Of course, but if the metadata is external to the file as it is in the 
> 'other fork' in an Apple filing system, you still have to make sure that 
> cp, mv and friends have all been rewritten to handle that.

Why "but"? That's exactly what I wrote. The kernel doesn't know what the
a process is intending to do with a file, therefore programs like cp,
tar, etc. must be rewritten to handle xattrs explicitely. (And many of
them have been rewritten, of course. Xattrs aren't new)


> You may well find that its easier to pull metadata management into the
> kernel because then you've only got one piece of code to maintain
> rather than tweaks in umpteen utility programs and libraries.

The problem is that this just doesn't fit into the Unix system call
scheme. There is no "copy" system call. The kernel just sees that a
process opens one file for reading and another file for writing. It
cannot assume that this process wants to copy the metadata from the
first to the second file. Of course Linux could introduce such a system
call, but then those umpteen utility programs and libraries would still
have to be modified to use that new system call.

	hp


-- 
   _  | Peter J. Holzer    | Fluch der elektronischen Textverarbeitung:
|_|_) | Sysadmin WSR       | Man feilt solange an seinen Text um, bis
| |   | hjp@hjp.at         | die Satzbestandteile des Satzes nicht mehr
__/   | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

A proposal to handle file encodings Roedy Green <see_website@mindprod.com.invalid> - 2012-11-22 13:36 -0800
  Re: A proposal to handle file encodings Joerg Meier <joergmmeier@arcor.de> - 2012-11-22 23:36 +0100
  Re: A proposal to handle file encodings markspace <-@.> - 2012-11-22 17:20 -0800
  Re: A proposal to handle file encodings Arne Vajhøj <arne@vajhoej.dk> - 2012-11-22 20:25 -0500
    Re: A proposal to handle file encodings markspace <-@.> - 2012-11-22 19:47 -0800
      Re: A proposal to handle file encodings Roedy Green <see_website@mindprod.com.invalid> - 2012-11-22 21:28 -0800
        Re: A proposal to handle file encodings Martin Gregorie <martin@address-in-sig.invalid> - 2012-11-24 15:51 +0000
          Re: A proposal to handle file encodings "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2012-11-25 10:18 +0100
            Re: A proposal to handle file encodings Martin Gregorie <martin@address-in-sig.invalid> - 2012-11-25 18:05 +0000
              Re: A proposal to handle file encodings "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2012-11-27 19:51 +0100
                Re: A proposal to handle file encodings Martin Gregorie <martin@address-in-sig.invalid> - 2012-11-29 02:22 +0000
                Re: A proposal to handle file encodings "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2012-12-02 13:02 +0100
                Re: A proposal to handle file encodings Martin Gregorie <martin@address-in-sig.invalid> - 2012-12-02 19:36 +0000
                Re: A proposal to handle file encodings "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2012-12-02 23:52 +0100
                Re: A proposal to handle file encodings Martin Gregorie <martin@address-in-sig.invalid> - 2012-12-02 23:08 +0000
    Re: A proposal to handle file encodings Sven Köhler <remove-sven.koehler@gmail.com> - 2012-11-25 13:13 +0100
      Re: A proposal to handle file encodings Martin Gregorie <martin@address-in-sig.invalid> - 2012-11-25 18:07 +0000
  Re: A proposal to handle file encodings Jan Burse <janburse@fastmail.fm> - 2012-11-23 16:33 +0100
    Re: A proposal to handle file encodings Roedy Green <see_website@mindprod.com.invalid> - 2012-11-23 09:02 -0800
      Re: A proposal to handle file encodings Jan Burse <janburse@fastmail.fm> - 2012-11-23 19:21 +0100
        Re: A proposal to handle file encodings "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2012-11-24 00:11 +0100
          Re: A proposal to handle file encodings Jan Burse <janburse@fastmail.fm> - 2012-11-24 00:53 +0100
            Re: A proposal to handle file encodings "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2012-11-24 09:13 +0100
            Re: A proposal to handle file encodings Roedy Green <see_website@mindprod.com.invalid> - 2012-11-24 06:50 -0800
              Re: A proposal to handle file encodings "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2012-11-25 10:07 +0100
                Re: A proposal to handle file encodings Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-11-25 11:06 -0600
                Re: A proposal to handle file encodings "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2012-11-27 19:28 +0100
          Re: A proposal to handle file encodings Roedy Green <see_website@mindprod.com.invalid> - 2012-11-24 06:42 -0800
            Re: A proposal to handle file encodings "Peter J. Holzer" <hjp-usenet2@hjp.at> - 2012-11-25 09:57 +0100
          Re: A proposal to handle file encodings Sven Köhler <remove-sven.koehler@gmail.com> - 2012-11-25 15:09 +0100
        Re: A proposal to handle file encodings Sven Köhler <remove-sven.koehler@gmail.com> - 2012-11-25 15:06 +0100
      Re: A proposal to handle file encodings Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-11-23 16:43 -0600
        Re: A proposal to handle file encodings Jan Burse <janburse@fastmail.fm> - 2012-11-24 01:02 +0100
      Re: A proposal to handle file encodings BGB <cr88192@hotmail.com> - 2012-11-25 14:36 -0600
        Re: A proposal to handle file encodings Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-11-25 16:51 -0600
          Re: A proposal to handle file encodings BGB <cr88192@hotmail.com> - 2012-11-25 17:54 -0600
          Re: A proposal to handle file encodings Jan Burse <janburse@fastmail.fm> - 2012-11-26 02:03 +0100
            Re: A proposal to handle file encodings Jan Burse <janburse@fastmail.fm> - 2012-11-26 02:20 +0100
              Re: A proposal to handle file encodings Martin Gregorie <martin@address-in-sig.invalid> - 2012-11-26 02:46 +0000

csiph-web