Skip to content
Snippets Groups Projects
Commit 8a0e461b authored by Eric Oulashin's avatar Eric Oulashin Committed by Rob Swindell
Browse files

DD Archive Viewer now supports the built-in Archive class in Synchronet 3.19

parent 722cd31c
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,12 @@ ...@@ -22,7 +22,12 @@
* directory is removed. * directory is removed.
*/ */
load("sbbsdefs.js"); "use strict";
if (typeof(require) === "function")
require("sbbsdefs.js", "K_UPPER");
else
load("sbbsdefs.js");
// Remove the Digital Distortion Archive Viewer work directory and // Remove the Digital Distortion Archive Viewer work directory and
// batch download directory. // batch download directory.
...@@ -42,65 +47,63 @@ file_remove(system.node_dir + "DDArcViewer_DLList.txt"); ...@@ -42,65 +47,63 @@ file_remove(system.node_dir + "DDArcViewer_DLList.txt");
// Return value: Boolean - Whether or not the directory was removed. // Return value: Boolean - Whether or not the directory was removed.
function deltree(pDir) function deltree(pDir)
{ {
if ((pDir == null) || (pDir == undefined)) if (typeof(pDir) !== "string")
return false; return false;
if (typeof(pDir) != "string") if (pDir.length == 0)
return false; return false;
if (pDir.length == 0) // Make sure pDir actually specifies a directory.
return false; if (!file_isdir(pDir))
// Make sure pDir actually specifies a directory. return false;
if (!file_isdir(pDir)) // Don't wipe out a root directory.
return false; if ((pDir == "/") || (pDir == "\\") || (/:\\$/.test(pDir)) || (/:\/$/.test(pDir)) || (/:$/.test(pDir)))
// Don't wipe out a root directory. return false;
if ((pDir == "/") || (pDir == "\\") || (/:\\$/.test(pDir)) || (/:\/$/.test(pDir)) || (/:$/.test(pDir)))
return false;
// If we're on Windows, then use the "RD /S /Q" command to delete // If we're on Windows, then use the "RD /S /Q" command to delete
// the directory. Otherwise, assume *nix and use "rm -rf" to // the directory. Otherwise, assume *nix and use "rm -rf" to
// delete the directory. // delete the directory.
if (deltree.inWindows == undefined) if (deltree.inWindows == undefined)
deltree.inWindows = (/^WIN/.test(system.platform.toUpperCase())); deltree.inWindows = (/^WIN/.test(system.platform.toUpperCase()));
if (deltree.inWindows) if (deltree.inWindows)
system.exec("RD " + withoutTrailingSlash(pDir) + " /s /q"); system.exec("RD " + withoutTrailingSlash(pDir) + " /s /q");
else else
system.exec("rm -rf " + withoutTrailingSlash(pDir)); system.exec("rm -rf " + withoutTrailingSlash(pDir));
// The directory should be gone, so we should return true. I'd like to verify that the // The directory should be gone, so we should return true. I'd like to verify that the
// directory really is gone, but file_exists() seems to return false for directories, // directory really is gone, but file_exists() seems to return false for directories,
// even if the directory does exist. So I test to make sure no files are seen in the dir. // even if the directory does exist. So I test to make sure no files are seen in the dir.
return (directory(pDir + "*").length == 0); return (directory(pDir + "*").length == 0);
/* /*
// Recursively deleting each file & dir using JavaScript: // Recursively deleting each file & dir using JavaScript:
var retval = true; var retval = true;
// Open the directory and delete each entry. // Open the directory and delete each entry.
var files = directory(pDir + "*"); var files = directory(pDir + "*");
for (var i = 0; i < files.length; ++i) for (var i = 0; i < files.length; ++i)
{ {
// If the entry is a directory, then deltree it (Note: The entry // If the entry is a directory, then deltree it (Note: The entry
// should have a trailing slash). Otherwise, delete the file. // should have a trailing slash). Otherwise, delete the file.
// If the directory/file couldn't be removed, then break out // If the directory/file couldn't be removed, then break out
// of the loop. // of the loop.
if (file_isdir(files[i])) if (file_isdir(files[i]))
{ {
retval = deltree(files[i]); retval = deltree(files[i]);
if (!retval) if (!retval)
break; break;
} }
else else
{ {
retval = file_remove(files[i]); retval = file_remove(files[i]);
if (!retval) if (!retval)
break; break;
} }
} }
// Delete the directory specified by pDir. // Delete the directory specified by pDir.
if (retval) if (retval)
retval = rmdir(pDir); retval = rmdir(pDir);
return retval; return retval;
*/ */
} }
// Removes a trailing (back)slash from a path. // Removes a trailing (back)slash from a path.
...@@ -111,16 +114,16 @@ function deltree(pDir) ...@@ -111,16 +114,16 @@ function deltree(pDir)
// Return value: The path without a trailing (back)slash. // Return value: The path without a trailing (back)slash.
function withoutTrailingSlash(pPath) function withoutTrailingSlash(pPath)
{ {
if ((pPath == null) || (pPath == undefined)) if ((pPath == null) || (pPath == undefined))
return ""; return "";
var retval = pPath; var retval = pPath;
if (retval.length > 0) if (retval.length > 0)
{ {
var lastIndex = retval.length - 1; var lastIndex = retval.length - 1;
var lastChar = retval.charAt(lastIndex); var lastChar = retval.charAt(lastIndex);
if ((lastChar == "\\") || (lastChar == "/")) if ((lastChar == "\\") || (lastChar == "/"))
retval = retval.substr(0, lastIndex); retval = retval.substr(0, lastIndex);
} }
return retval; return retval;
} }
\ No newline at end of file
; Compressed archive file extensions ; Compressed archive file extensions
[ZIP] [ZIP]
; PKZip for Win32
;VIEW=\BBS\COMPRESS\pkzip25.exe -view -NoZipExtension %FILENAME%
;EXTRACT=\BBS\COMPRESS\pkzip25.exe -extract -NoZipExtension -Directories %FILENAME% %FILESPEC% %TO_DIR%
; Info-ZIP for Win32 console (comes with Synchronet)
VIEW=\BBS\sbbs\exec\unzip.exe -l %FILENAME%
EXTRACT=\BBS\sbbs\exec\unzip.exe -qq -o %FILENAME% %FILESPEC% -d %TO_DIR%
; Info-ZIP, *nix ; Info-ZIP, *nix
;VIEW=unzip -l %FILENAME% VIEW=unzip -l %FILENAME%
;EXTRACT=unzip -qq -o %FILENAME% %FILESPEC% -d %TO_DIR% EXTRACT=unzip -qq -o %FILENAME% %FILESPEC% -d %TO_DIR%
; 7-Zip for Win32 console
;VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
;EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; 7-Zip for *nix ; 7-Zip for *nix
;VIEW=7za l %FILENAME% ;VIEW=7z l %FILENAME%
;EXTRACT=7za x -y %FILENAME% %FILESPEC% -o%TO_DIR% ;EXTRACT=7z x -y -pxyz %FILENAME% %FILESPEC% -o%TO_DIR%
[7Z] [7Z]
; 7-Zip for Win32 console
VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; 7-Zip for *nix ; 7-Zip for *nix
;VIEW=7za l %FILENAME% VIEW=7z l %FILENAME%
;EXTRACT=7za x -y %FILENAME% %FILESPEC% -o%TO_DIR% EXTRACT=7z x -y -pxyz %FILENAME% %FILESPEC% -o%TO_DIR%
[RAR] [RAR]
; RAR for Win32 console VIEW=rar lt %FILENAME%
VIEW=\BBS\COMPRESS\Rar.exe lt %FILENAME% EXTRACT=rar x -p- -y %FILENAME% %FILESPEC% %TO_DIR%
EXTRACT=\BBS\COMPRESS\Rar.exe x %FILENAME% %FILESPEC% %TO_DIR%
; Alexander Roshal's unrar for *nix ; Alexander Roshal's unrar for *nix
;VIEW=unrar lt %FILENAME% ;VIEW=unrar lt %FILENAME%
;EXTRACT=unrar x %FILENAME% %FILESPEC% %TO_DIR% ;EXTRACT=unrar x %FILENAME% %FILESPEC% %TO_DIR%
[ARJ] [ARJ]
; ARJ for Win32 console
VIEW=\BBS\COMPRESS\ARJ32.EXE l %FILENAME%
EXTRACT=\BBS\COMPRESS\ARJ32.EXE x %FILENAME% %FILESPEC% -ht%TO_DIR%
; Open-Source ARJ for *nix ; Open-Source ARJ for *nix
;VIEW=arj l %FILENAME% VIEW=arj l %FILENAME%
;EXTRACT=arj x %FILENAME% %FILESPEC% -ht%TO_DIR% EXTRACT=arj x %FILENAME% %FILESPEC% -ht%TO_DIR%
[ISO] [ISO]
; 7-Zip for Win32 console
VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; 7-Zip for *nix ; 7-Zip for *nix
;VIEW=7za l %FILENAME% VIEW=7z l %FILENAME%
;EXTRACT=7za x -y %FILENAME% %FILESPEC% -o%TO_DIR% EXTRACT=7z x -y %FILENAME% %FILESPEC% -o%TO_DIR%
[TAR] [TAR]
; 7-Zip for Win32 console
VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; 7-Zip for *nix ; 7-Zip for *nix
;VIEW=7za l %FILENAME% VIEW=7z l %FILENAME%
;EXTRACT=7za x -y %FILENAME% %FILESPEC% -o%TO_DIR% EXTRACT=7z x -y -pxyz %FILENAME% %FILESPEC% -o%TO_DIR%
[GZ] [GZ]
; 7-Zip for Win32 console
VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; 7-Zip for *nix ; 7-Zip for *nix
;VIEW=7za l %FILENAME% VIEW=7z l %FILENAME%
;EXTRACT=7za x -y %FILENAME% %FILESPEC% -o%TO_DIR% EXTRACT=7z x -y -pxyz %FILENAME% %FILESPEC% -o%TO_DIR%
[TGZ] [TGZ]
; gzip for Win32 cmmand-line
;VIEW=\BBS\COMPRESS\gzip.exe -l %FILENAME%
; 7-Zip for Win32 console
VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; 7-Zip for *nix ; 7-Zip for *nix
;VIEW=7za l %FILENAME% VIEW=7z l %FILENAME%
;EXTRACT=7za x -y %FILENAME% %FILESPEC% -o%TO_DIR% EXTRACT=7z x -y -pxyz %FILENAME% %FILESPEC% -o%TO_DIR%
[TAR.GZ] [TAR.GZ]
; 7-Zip for Win32 console
VIEW=\BBS\COMPRESS\7za.exe l %FILENAME%
EXTRACT=\BBS\COMPRESS\7za.exe x -y %FILENAME% %FILESPEC% -o%TO_DIR%
; tar for *nix ; tar for *nix
;VIEW=tar ztvf %FILENAME% VIEW=tar ztvf %FILENAME%
;EXTRACT=cd %TO_DIR% && tar zxvf %FILENAME% EXTRACT=cd %TO_DIR% && tar zxvf %FILENAME%
; Microsoft Installer file
[MSI]
; 7-Zip for *nix
VIEW=7z l %FILENAME%
EXTRACT=7z x -y -pxyz %FILENAME% %FILESPEC% -o%TO_DIR%
; Text file extensions ; Text file extensions
[TXT] [TXT]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[TEXT] [TEXT]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[DIZ] [DIZ]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[DOC] [DOC]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[ANS] [ANS]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[ASC] [ASC]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[ASCII] [ASCII]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[RIP] [RIP]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[NFO] [NFO]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Chinese text file ; Chinese text file
[ZW] [ZW]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[NEW]
IsText=Yes
; *nix
VIEW=cat %FILENAME%
[BBS] [BBS]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[ICE] [ICE]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[LOG] [LOG]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Guitar tab file ; Guitar tab file
[TAB] [TAB]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Guitar tab file ; Guitar tab file
[CRD] [CRD]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Guitar tab file ; Guitar tab file
[CHORD] [CHORD]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix
;VIEW=cat %FILENAME%
[NEW]
IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Readme file (i.e., READ.ME) ; Readme file (i.e., READ.ME)
[ME] [ME]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[FAQ] [FAQ]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[NOW] [NOW]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[HTM] [HTM]
IsText=Yes IsText=Yes
...@@ -238,269 +171,201 @@ VIEW=?typehtml -color %FILENAME% ...@@ -238,269 +171,201 @@ VIEW=?typehtml -color %FILENAME%
[REG] [REG]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; A readme file, as in README.1ST ; A readme file, as in README.1ST
[1ST] [1ST]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[CFG] [CFG]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
[INI] [INI]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Batch file ; Batch file
[BAT] [BAT]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Command lst file (similar to a DOS batch file) ; Command lst file (similar to a DOS batch file)
[CMD] [CMD]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; REXX script (a programming language developed by IBM) ; REXX script (a programming language developed by IBM)
[REXX] [REXX]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; *nix shell script ; *nix shell script
[SH] [SH]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Outlook Express email message ; Outlook Express email message
[EMAIL] [EMAIL]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Mail message ; Mail message
[EMLX] [EMLX]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; EditPad Pro ; EditPad Pro
[EPP] [EPP]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Error log ; Error log
[ERR] [ERR]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Outlook Express mailbox index file ; Outlook Express mailbox index file
[IDX] [IDX]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Data list ; Data list
[LST] [LST]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Mailbox message file ; Mailbox message file
[MSG] [MSG]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; JavaScript source file ; JavaScript source file
[JS] [JS]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Perl source file ; Perl source file
[PL] [PL]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Python source file ; Python source file
[PY] [PY]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; PHP source file ; PHP source file
[PHP] [PHP]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; C source file ; C source file
[C] [C]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; C++ source file ; C++ source file
[CPP] [CPP]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; C++ source file ; C++ source file
[CXX] [CXX]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; C++ source file ; C++ source file
[C++] [C++]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Header file for C/C++/Objective-C/etc. ; Header file for C/C++/Objective-C/etc.
[H] [H]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; C++ header file ; C++ header file
[HPP] [HPP]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Objective-C source file ; Objective-C source file
[M] [M]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Objective-C with C++ source file ; Objective-C with C++ source file
[MM] [MM]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; C# source file ; C# source file
[CS] [CS]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Pascal source file ; Pascal source file
[PAS] [PAS]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; BASIC source file ; BASIC source file
[BAS] [BAS]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Visual Basic source file ; Visual Basic source file
[VB] [VB]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Common Gateway Interface script ; Common Gateway Interface script
[CGI] [CGI]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Include file ; Include file
[INC] [INC]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% VIEW=cat %FILENAME%
; Baja source file (for Synchronet scripts) ; Baja source file (for Synchronet scripts)
[SRC] [SRC]
IsText=Yes IsText=Yes
; Windows
VIEW=type %FILENAME%
; *nix ; *nix
;VIEW=cat %FILENAME% :VIEW=cat %FILENAME%
\ No newline at end of file \ No newline at end of file
Digital Distortion Archive Viewer Digital Distortion Archive Viewer
Version 1.03 Version 1.04
Release date: 2009-12-20 Release date: 2022-05-16
by by
Eric Oulashin Eric Oulashin
Sysop of Digital Distortion BBS Sysop of Digital Distortion BBS
BBS internet address: digitaldistortionbbs.com BBS internet address: digitaldistortionbbs.com
digdist.bbsindex.com digdist.synchro.net
Email: eric.oulashin@gmail.com Email: eric.oulashin@gmail.com
...@@ -18,7 +18,7 @@ Contents ...@@ -18,7 +18,7 @@ Contents
======== ========
1. Disclaimer 1. Disclaimer
2. Introduction 2. Introduction
3. Archive File Software 3. Archive Formats
4. Installation and Setup 4. Installation and Setup
5. Main configuration file 5. Main configuration file
6. Archive file type configuration file 6. Archive file type configuration file
...@@ -77,8 +77,16 @@ queue. The reason is that Synchronet won't add files to the user's ...@@ -77,8 +77,16 @@ queue. The reason is that Synchronet won't add files to the user's
download queue unless the file is in Synchronet's file database. download queue unless the file is in Synchronet's file database.
3. Archive File Software 3. Archive Formats
======================== ==================
If your BBS is running Synchronet 3.19 or newer, Digital Distortion Archive
Viewer makes use of the built-in archive support in Synchronet for fast
extraction (it supports zip, 7z, tgz, etc.). You can also configure archiver
commands to extract other formats if you want. If your version of Synchronet
3.18 or below, then you will need to configure archiver extraction commands for
all archive file types you want to support.
Digital Distortion Archive Viewer comes with configurations to handle Digital Distortion Archive Viewer comes with configurations to handle
ZIP, 7Z (7-Zip), RAR, ARJ, TAR, GZ, TGZ, and TAR.GZ archives, and many ZIP, 7Z (7-Zip), RAR, ARJ, TAR, GZ, TGZ, and TAR.GZ archives, and many
text file formats. text file formats.
...@@ -87,30 +95,30 @@ The file format configuration file included with this script includes ...@@ -87,30 +95,30 @@ The file format configuration file included with this script includes
VIEW and EXTRACT command lines for various archivers for both Windows VIEW and EXTRACT command lines for various archivers for both Windows
and Linux. In order for this script to work properly, you will need and Linux. In order for this script to work properly, you will need
to make sure you have the appropriate archiver software installed on to make sure you have the appropriate archiver software installed on
your system, and you will need to edit the DDArcViewerFileTypes.cfg your system, and you will need to edit the dd_arc_viewer_file_types.cfg
file (using a text editor) and make sure you have the VIEW and file (using a text editor) and make sure you have the VIEW and
EXTRACT command lines set properly for your archiver software. EXTRACT command lines set properly for your archiver software.
The included DDArcViewerFileTypes.cfg file has command lines for The included dd_arc_viewer_file_types.cfg file has command lines for
Windows and Linux, and the Linux command lines are commented out. Windows and Linux, and the Linux command lines are commented out.
For information on that configuration file, see section 6: Archive For information on that configuration file, see section 6: Archive
file type configuration file. file type configuration file.
The following archive contains Win32 command-line archivers for popular The following archive contains Win32 command-line archivers for popular
archive file formats: archive file formats:
http://digdist.bbsindex.com/miscFilesForDL/Win32CmdLineCompressionTools.zip http://digdist.synchro.net/miscFilesForDL/Win32CmdLineCompressionTools.zip
The archivers included in that archive handle the most popular file formats The archivers included in that archive handle the most popular file formats
(ZIP, 7Z (7-Zip), RAR, ARJ, TAR, GZ, TGZ, and TAR.GZ), and they are set up in (ZIP, 7Z (7-Zip), RAR, ARJ, TAR, GZ, TGZ, and TAR.GZ), and they are set up in
DDArcViewerFileTypes.cfg. If your BBS is running in Windows, the included dd_arc_viewer_file_types.cfg. If your BBS is running in Windows, the included
configuration file should work for you - But note that you will need to edit configuration file should work for you - But note that you will need to edit
the DDArcViewerFileTypes.cfg file and change the paths to the .exe files the dd_arc_viewer_file_types.cfg file and change the paths to the .exe files
according to where you copied them to your system. If you are running Linux, according to where you copied them to your system. If you are running Linux,
that .cfg file also has the Linux command lines as comments). that .cfg file also has the Linux command lines as comments).
If you copy the archivers to a directory that is not in your system path, you If you copy the archivers to a directory that is not in your system path, you
will need to edit the DDArcViewerFileTypes.cfg file to include the full paths will need to edit the dd_arc_viewer_file_types.cfg file to include the full paths
with the archive executables. with the archive executables.
The configuration file DDArcViewerFileTypes.cfg includes a setup The configuration file dd_arc_viewer_file_types.cfg includes a setup
for using 7-Zip to extract ISO (CD/DVD image) files; however, in for using 7-Zip to extract ISO (CD/DVD image) files; however, in
testing, it seemed that 7-Zip can only extract or see one file in testing, it seemed that 7-Zip can only extract or see one file in
an ISO image. an ISO image.
...@@ -163,16 +171,17 @@ Step 1: Copy the script files, configuration files, & archivers to your system ...@@ -163,16 +171,17 @@ Step 1: Copy the script files, configuration files, & archivers to your system
Digital Distortion Archive Viewer consists of the following 4 files, which Digital Distortion Archive Viewer consists of the following 4 files, which
you will need to place in your sbbs/exec directory (or another directory of you will need to place in your sbbs/exec directory (or another directory of
your choice): your choice):
1. DDArcViewer.js 1. dd_arc_viewer.js
2. DDArcViewerCleanup.js 2. dd_arc_viewer_cleanup.js
3. DDArcViewer.cfg 3. dd_arc_viewer.cfg
4. DDArcViewerFileTypes.cfg 4. dd_arc_viewer_file_types.cfg
These files must be all together in the same directory. These files must be all together in the same directory.
For sysops running their BBS in Windows, the following archiver programs For sysops running their BBS in Windows using Synchronet 3.18 or below, the
in the Win32Archivers directory will need to be placed in a directory following archiver programs in the Win32Archivers directory will need to be
(preferably a directory that's included in the system's path): placed in a directory (preferably a directory that's included in the system's
path):
1. 7za.exe 1. 7za.exe
2. ARJ32.EXE 2. ARJ32.EXE
3. Rar.exe 3. Rar.exe
...@@ -183,13 +192,13 @@ the appropriate archivers as described in the previous section. ...@@ -183,13 +192,13 @@ the appropriate archivers as described in the previous section.
Step 2: Edit the configuration files Step 2: Edit the configuration files
------------------------------------ ------------------------------------
At a minimum, you will need to edit DDArcViewerFileTypes.cfg to make sure At a minimum, you will need to edit dd_arc_viewer_file_types.cfg to make sure
that the archive command lines are correct for your system and that the text that the archive command lines are correct for your system and that the text
view commands are correct. If you're running your BBS in Linux, you will view commands are correct. If you're running your BBS in Linux, you will
first need to comment the Windows command lines and uncomment the Linux first need to comment the Windows command lines and uncomment the Linux
command lines. See section 6: Archive file type configuration file. command lines. See section 6: Archive file type configuration file.
If desired, you can also edit DDArcViewer.cfg to change script options If desired, you can also edit dd_arc_viewer.cfg to change script options
such as the interface type (lightbar/traditional) and colors. See section such as the interface type (lightbar/traditional) and colors. See section
5: Main configuration file. 5: Main configuration file.
...@@ -207,18 +216,18 @@ INS, the line below (or above) will be copied and inserted as a new line. ...@@ -207,18 +216,18 @@ INS, the line below (or above) will be copied and inserted as a new line.
When editing a viewable file type, you will need to enter the file extension When editing a viewable file type, you will need to enter the file extension
and the command line used to view it. The file extension is fairly and the command line used to view it. The file extension is fairly
self-explanatory. For the command line, use the following (this assumes self-explanatory. For the command line, use the following (this assumes
DDArcViewer.js was copied to your sbbs\exec diretory): dd_arc_viewer.js was copied to your sbbs\exec diretory):
?DDArcViewer.js %s ?dd_arc_viewer.js %s
If you copied DDArcViewer.js and its other files to another directory, you If you copied dd_arc_viewer.js and its other files to another directory, you
will need to provide the path to DDArcViewer.js (i.e., will need to provide the path to dd_arc_viewer.js (i.e.,
?/sbbs/ArcViewer/DDArcViewer.js %s). As an example, your Viewable File Type ?/sbbs/ArcViewer/dd_arc_viewer.js %s). As an example, your Viewable File Type
window should look similar to the following: window should look similar to the following:
+[¦][?]--------------------------------------+ +[|][?]--------------------------------------+
¦ Viewable File Type ¦ | Viewable File Type |
¦--------------------------------------------¦ |--------------------------------------------|
¦ ¦File Extension ZIP ¦ | |File Extension ZIP |
¦ ¦Command Line ?DDArcViewer.js %f ¦ | |Command Line ?dd_arc_viewer.js %f |
¦ ¦Access Requirements ¦ | |Access Requirements |
+--------------------------------------------+ +--------------------------------------------+
...@@ -233,7 +242,7 @@ interfere with the next user's use of the archive viewer. ...@@ -233,7 +242,7 @@ interfere with the next user's use of the archive viewer.
If you are not already using a logout script, follow these steps: If you are not already using a logout script, follow these steps:
1. Create a file in your sbbs\exec directory called logout.js 1. Create a file in your sbbs\exec directory called logout.js
2. Add this line to it (assuming that the archive viewer scripts are in sbbs\exec): 2. Add this line to it (assuming that the archive viewer scripts are in sbbs\exec):
load("DDArcViewerCleanup.js"); load("dd_arc_viewer_cleanup.js");
3. Add your logout script to Synchronet's configuration: 3. Add your logout script to Synchronet's configuration:
A. Run Synchronet's configuration program (SCFG) A. Run Synchronet's configuration program (SCFG)
B. From the main menu, choose "System". B. From the main menu, choose "System".
...@@ -245,7 +254,7 @@ load("DDArcViewerCleanup.js"); ...@@ -245,7 +254,7 @@ load("DDArcViewerCleanup.js");
If you already have a logout script (using JavaScript), you just need to add the If you already have a logout script (using JavaScript), you just need to add the
following line to it: following line to it:
load("DDArcViewerCleanup.js"); load("dd_arc_viewer_cleanup.js");
Step 5: If you use a JavaScript command shell, update it Step 5: If you use a JavaScript command shell, update it
...@@ -264,7 +273,7 @@ from triggering actions in your command shell. ...@@ -264,7 +273,7 @@ from triggering actions in your command shell.
5. Main configuration file 5. Main configuration file
========================== ==========================
If you want to change the default beavior and colors, you can edit the If you want to change the default beavior and colors, you can edit the
DDArcViewer.cfg file, which is a plain text file. The configuration file dd_arc_viewer.cfg file, which is a plain text file. The configuration file
has two sections: A behavior section (denoted by [BEHAVIOR]) and a colors has two sections: A behavior section (denoted by [BEHAVIOR]) and a colors
section (denoted by [COLORS]). For each setting or color, the syntax is as section (denoted by [COLORS]). For each setting or color, the syntax is as
folows: folows:
...@@ -347,7 +356,7 @@ highlightedFile Selected files in lightbar mode ...@@ -347,7 +356,7 @@ highlightedFile Selected files in lightbar mode
6. Archive file type configuration file 6. Archive file type configuration file
======================================= =======================================
The configuration file DDArcViewerFileTypes.cfg defines the files that The configuration file dd_arc_viewer_file_types.cfg defines the files that
you want to be viewable by the archive viewer. Viewable file types are you want to be viewable by the archive viewer. Viewable file types are
specified by their extension in square brackets. Each archive file type specified by their extension in square brackets. Each archive file type
must have a view command and an extract command. Text files must have only must have a view command and an extract command. Text files must have only
...@@ -385,4 +394,4 @@ Using the above example configuration for zip files, if the user (on node 1) ...@@ -385,4 +394,4 @@ Using the above example configuration for zip files, if the user (on node 1)
wants to view D:\Files\someArchive.zip, and the temp directory is wants to view D:\Files\someArchive.zip, and the temp directory is
D:\sbbs\node1\DDArcViewerTemp, the extract command will be translated to the D:\sbbs\node1\DDArcViewerTemp, the extract command will be translated to the
following: following:
unzip.exe -qq -o D:\Files\someArchive.zip -d D:\sbbs\node1\DDArcViewerTemp unzip.exe -qq -o D:\Files\someArchive.zip -d D:\sbbs\node1\DDArcViewerTemp
\ No newline at end of file
...@@ -2,6 +2,10 @@ Revision History for Digital Distortion Archive Viewer ...@@ -2,6 +2,10 @@ Revision History for Digital Distortion Archive Viewer
====================================================== ======================================================
Version Date Description Version Date Description
------- ---- ----------- ------- ---- -----------
1.04 2022-05-16 Updated to use the new Archive class in Synchronet 3.19.
Now has built-in support for the same archive types that
Synchronet has built-in (zip, 7z, tgz, etc.). Other
archive types can still be configured.
1.03 2009-12-20 Updated DDArcViewer.js to be able to handle command-line 1.03 2009-12-20 Updated DDArcViewer.js to be able to handle command-line
parameters with spaces in them as single parameters, parameters with spaces in them as single parameters,
thanks to a function posted by Tracker1 of The Roughnecks thanks to a function posted by Tracker1 of The Roughnecks
...@@ -12,4 +16,4 @@ Version Date Description ...@@ -12,4 +16,4 @@ Version Date Description
by the JavaScript script. by the JavaScript script.
1.01 2009-12-16 Minor update to the documentation. 1.01 2009-12-16 Minor update to the documentation.
1.00 2009-09-10 First general public release 1.00 2009-09-10 First general public release
0.99 2009-09-02 Beta test, pre-general release verison. 0.99 2009-09-02 Beta test, pre-general release verison.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment