Re: New Feature: addfiles.js
By: Rob Swindell to GitLab note in main/sbbs on Wed Feb 23 2022 06:08 pm
https://gitlab.synchro.net/main/sbbs/-/issues/348#note_2309
Try that, CG!
Still doesn't seem to isolate the one file, and is updating all of them in that one filebase. Here is the output with command line. As you can see by the command line, I'm only trying to update the file called filelist.zip in the file base newuser for my weekly event, but it seems to be updating all of the files. Although it doesn't phisicly update any info on any of the files but filelist.zip, as nothing in the other files changes, with the new option it should just show updating the one file and not look for others. My reasoning may be flawed here, but that what I envisoned how the new option would function.
C:\SBBS\exec>jsexec addfiles -debug -file=filelist.zip -update newuser
Adding files to Main New User Files
FILELIST.ZIP
PKZ204G.EXE
REGISTER.EXE
VALHALLA.ZIP
VALPAPER.ZIP
{
"name": "FILELIST.ZIP"
}
Updated FILELIST.ZIP
{
"name": "PKZ204G.EXE"
}
Updated PKZ204G.EXE
{
"name": "REGISTER.EXE"
}
Updated REGISTER.EXE
{
"name": "VALHALLA.ZIP"
}
Updated VALHALLA.ZIP
{
"name": "VALPAPER.ZIP"
}
Updated VALPAPER.ZIP
0 files added
5 files updated
The batch file I use for this event is:
cd\sbbs\exec
if exist c:\sbbs\data\dirs\newuser\nodelist.zip del c:\sbbs\data\dirs\newuser\nodelist.zip
jsexec filelist -all -hdr -pad -size=1 -sort -ext > c:\sbbs\data\dirs\newuser\FILELIST.TXT
zip.exe -D -T -v c:\sbbs\data\dirs\newuser\FILELIST.ZIP c:\sbbs\data\dirs\newuser\FILELIST.TXT
if exist c:\sbbs\data\dirs\newuser\filelist.txt del c:\sbbs\data\dirs\newuser\filelist.txt
jsexec addfiles -debug -file=filelist.zip -update newuser
I delete the filelist.txt file before I run addfiles, as addfiles picks it up as a stray file, and adds it to the database even if I specify -file=filelist.zip on the command line.
Hope this helps with the enhancement I was asking for. as for using postfile.js, I tried that, but it won't just update a single file, it just exits stating file exists in database. Maybe I'm thinking wrong, maybe the enhancement should be with postfile to update the single file with a switch?
<< C.G. >>
---
þ Synchronet þ Valhalla Home Services þ USA þ
http://valhalla.synchro.net
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)