prefer local files to network connections

2024-01-30 Thread Karl Berry
I suggest that tar check if a file exists before trying to make a network connection. This would eliminate the need for --force-local in (I expect) most cases. As in: $ touch foo:bar $ tar xf foo:bar tar: Cannot connect to foo: resolve failed whereas I'd prefer/expect the usual error: tar: This d

Re: prefer local files to network connections

2024-01-30 Thread Sergey Poznyakoff
Hi Karl! > I suggest that tar check if a file exists before trying to make a > network connection. This would eliminate the need for --force-local in > (I expect) most cases. As in: Nice idea. I'll implement it. > Also, since the whole idea of tar making network connections is highly > non-trad

Re: prefer local files to network connections

2024-01-30 Thread Paul Eggert
On 2024-01-30 10:09, Sergey Poznyakoff wrote: Hi Karl! I suggest that tar check if a file exists before trying to make a network connection. This would eliminate the need for --force-local in (I expect) most cases. As in: Nice idea. I'll implement it. Wait, does this mean 'tar -cf host:fil

Re: prefer local files to network connections

2024-01-30 Thread Martin Simmons
> On Tue, 30 Jan 2024 19:09:45 +0100, Sergey Poznyakoff said: > > > I suggest that tar check if a file exists before trying to make a > > network connection. This would eliminate the need for --force-local in > > (I expect) most cases. As in: > > Nice idea. I'll implement it. Is there a pot

Re: prefer local files to network connections

2024-01-30 Thread Sam James
Karl Berry writes: > I suggest that tar check if a file exists before trying to make a > network connection. This would eliminate the need for --force-local in > (I expect) most cases. As in: > > $ touch foo:bar > $ tar xf foo:bar > tar: Cannot connect to foo: resolve failed > > whereas I'd pre

Re: prefer local files to network connections

2024-01-30 Thread Paul Eggert
On 2024-01-30 10:57, Sam James wrote: The whole thing is bizarre and continues to catch people by surprise: https://lists.gnu.org/archive/html/bug-tar/2017-05/msg2.html. Yes, if I could go back decades in time I would say "don't implement it that way -- add an option instead!" What 'tar' c

Re: prefer local files to network connections

2024-01-30 Thread Paul Eggert
On 2024-01-30 11:02, Paul Eggert wrote: Perhaps it's time to evolve tar in the direction that it should have gone back in the 1980s. That is, we add an option --remote to require remote interpretation of file names, and warn if a remote file name is used without --remote. Eventually we can make

Re: prefer local files to network connections

2024-01-30 Thread Karl Berry
Wait, does this mean 'tar -cf host:file ...' will overwrite the local file 'host:file' only if that file already exists? That sounds confusing. I was only thinking about reading (tf, xf). I agree it would be weird on creation. suggesting to me that I should put 'export TAR_OPTIONS=--