Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Sears has everything.


dovenet / Synchronet Javascript / Archive.extract() with max_files parameter

SubjectAuthor
* Archive.extract() with max_files parameterNightfox
`* Archive.extract() with max_files parameterDigital Man
 `- Archive.extract() with max_files parameterNightfox

1
Archive.extract() with max_files parameter

<62E950FF.3685.dove_sync_js@digitaldistortionbbs.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=817&group=DOVE-Net.Synchronet_Javascript#817

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: nightfox@VERT/DIGDIST (Nightfox)
To: Digital Man
Subject: Archive.extract() with max_files parameter
Message-ID: <62E950FF.3685.dove_sync_js@digitaldistortionbbs.com>
Date: Tue, 2 Aug 2022 02:29:51 -0700
X-Comment-To: Digital Man
Path: rocksolidbbs.com!not-for-mail
Organization: Digital Distortion
Newsgroups: DOVE-Net.Synchronet_Javascript
X-FTN-PID: Synchronet 3.19c-Linux master/daf48cf87 Jul 4 2022 GCC 9.4.0
X-FTN-CHRS: CP437 2
WhenImported: 20220802095637-0700 c1e0
WhenExported: 20220802151849-0700 c1e0
ExportedFrom: VERT sync-js 3752
WhenImported: 20220802092951-0700 c1e0
WhenExported: 20220802095632-0700 c1e0
ExportedFrom: DIGDIST dove_sync_js 3685
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Nightfox - Tue, 2 Aug 2022 09:29 UTC

Hi DM,

Today I was using the Archive class to extract exactly one file from a zip file, and I'm a little confused on the exception throwing behavior regarding the max_files parameter. When calling extract(), I gave it a filename pattern and expected exactly 1 file to be extracted, so I also gave a max_files argument as 1. It extracted the one file, but it threw an exception with the error "Error: maximum number of files (1) extracted (after extracting 1 item successfully)".

Should that be an error condition to throw an exception? I expected 1 file to be extracted, and that file was extracted successfully. If I specify max_files as 2, then it doesn't throw an exception.

Nightfox

---
■ Synchronet ■ Digital Distortion: digitaldistortionbbs.com

Archive.extract() with max_files parameter

<62E9BF5D.3753.sync-js@vert.synchro.net>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=818&group=DOVE-Net.Synchronet_Javascript#818

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: digital.man@VERT (Digital Man)
To: Nightfox
Subject: Archive.extract() with max_files parameter
Message-ID: <62E9BF5D.3753.sync-js@vert.synchro.net>
Date: Tue, 2 Aug 2022 10:20:45 -0700
X-Comment-To: Nightfox
Path: rocksolidbbs.com!not-for-mail
Organization: Vertrauen
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <62E950FF.3685.dove_sync_js@digitaldistortionbbs.com>
References: <62E950FF.3685.dove_sync_js@digitaldistortionbbs.com>
X-FTN-PID: Synchronet 3.19c-Linux master/c4fe3cf5f Jul 10 2022 GCC 8.3.0
X-FTN-CHRS: CP437 2
WhenImported: 20220802172045-0700 c1e0
WhenExported: 20220802211853-0700 c1e0
ExportedFrom: VERT sync-js 3753
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Digital Man - Tue, 2 Aug 2022 17:20 UTC

Re: Archive.extract() with max_files parameter
By: Nightfox to Digital Man on Tue Aug 02 2022 09:29 am

> Hi DM,
>
> Today I was using the Archive class to extract exactly one file from a zip
> file, and I'm a little confused on the exception throwing behavior regarding
> the max_files parameter. When calling extract(), I gave it a filename
> pattern and expected exactly 1 file to be extracted, so I also gave a
> max_files argument as 1. It extracted the one file, but it threw an
> exception with the error "Error: maximum number of files (1) extracted
> (after extracting 1 item successfully)".
>
> Should that be an error condition to throw an exception? I expected 1 file
> to be extracted, and that file was extracted successfully. If I specify
> max_files as 2, then it doesn't throw an exception.

I can see how that would be surprising behavior. I just committed a change. Let me know how that works for you.
--
digital man (rob)

Breaking Bad quote #22:
I got one more shot at that little skid mark. - Hank Schrader
Norco, CA WX: 87.3°F, 35.0% humidity, 12 mph SSE wind, 0.00 inches rain/24hrs
---
■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net

Archive.extract() with max_files parameter

<62EA9B97.3687.dove_sync_js@digitaldistortionbbs.com>

  copy mid

https://www.rocksolidbbs.com/dovenet/article-flat.php?id=819&group=DOVE-Net.Synchronet_Javascript#819

  copy link   Newsgroups: DOVE-Net.Synchronet_Javascript
From: nightfox@VERT/DIGDIST (Nightfox)
To: Digital Man
Subject: Archive.extract() with max_files parameter
Message-ID: <62EA9B97.3687.dove_sync_js@digitaldistortionbbs.com>
Date: Wed, 3 Aug 2022 02:00:23 -0700
X-Comment-To: Digital Man
Path: rocksolidbbs.com!not-for-mail
Organization: Digital Distortion
Newsgroups: DOVE-Net.Synchronet_Javascript
In-Reply-To: <62E9BF5D.3753.sync-js@vert.synchro.net>
References: <62E9BF5D.3753.sync-js@vert.synchro.net>
X-FTN-PID: Synchronet 3.19c-Linux master/bff68ad04 Aug 3 2022 GCC 9.4.0
X-FTN-CHRS: CP437 2
WhenImported: 20220803092745-0700 c1e0
WhenExported: 20220803151852-0700 c1e0
ExportedFrom: VERT sync-js 3754
WhenImported: 20220803090023-0700 c1e0
WhenExported: 20220803092741-0700 c1e0
ExportedFrom: DIGDIST dove_sync_js 3687
Content-Type: text/plain; charset=IBM437
Content-Transfer-Encoding: 8bit
 by: Nightfox - Wed, 3 Aug 2022 09:00 UTC

Re: Archive.extract() with max_files parameter
By: Digital Man to Nightfox on Tue Aug 02 2022 05:20 pm

>> a filename pattern and expected exactly 1 file to be extracted, so I
>> also gave a max_files argument as 1. It extracted the one file, but
>> it threw an exception with the error "Error: maximum number of files
>> (1) extracted (after extracting 1 item successfully)".

DM> I can see how that would be surprising behavior. I just committed a
DM> change. Let me know how that works for you.

I've updated, and now it doesn't throw an exception for this case. Thanks.

Nightfox

---
■ Synchronet ■ Digital Distortion: digitaldistortionbbs.com

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor