Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!usenet.ukfsn.org!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: A proposal to handle file encodings Date: Thu, 29 Nov 2012 02:22:49 +0000 (UTC) Organization: UK Free Software Network Lines: 38 Message-ID: References: <50aed080$0$292$14726298@news.sunsite.dk> NNTP-Posting-Host: 84.45.235.129 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: localhost.localdomain 1354155769 14922 84.45.235.129 (29 Nov 2012 02:22:49 GMT) X-Complaints-To: usenet@localhost.localdomain NNTP-Posting-Date: Thu, 29 Nov 2012 02:22:49 +0000 (UTC) User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Xref: csiph.com comp.lang.java.programmer:20015 On Tue, 27 Nov 2012 19:51:37 +0100, Peter J. Holzer wrote: > 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. > 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. > I can see two ways of handling it: (1) introduce a pair of systems calls to retrieve and store the metadata associated with a file, and, yes, programs would need modification, but the amount would be trivial because you'd be looking at one extra line of code per file involved in the metadata transfer. (2) alternatively it may be possible to do the job by adding a mode or to to the file opening operations. If they were defaulted appropriately, many programs could silently copy the metadata along with the data and/or automagically apply the appropriate transforms, such as charset transforms, during the transfer. Thinking about it a little more, (2) is definitely the best solution because it would be rather useful to be able to default the metadata applied to a new file with a similar mechanism to that used for the permission bits. This sort of thing would be much easier to manage it is was built in to the filing system. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |