Article View: news.software.readers
Article #241730--
From: Unknown
Date: Sat, 17 Jul 2010 03:35
Date: Sat, 17 Jul 2010 03:35
58 lines
3682 bytes
3682 bytes
<PRE>
unLike Info·Zip, 7Zip archives UTF·8 paths/file·names; e.g.:
“ 7z.EXE A -sccUTF-8 -ssw Something.ZIP @UTF·8·List·of·files.TXT ”.
Both 7Zip and Info·Zip are cost·free, but 7Zip is more Windows aware.
A 7Zip bug:
Wildcarding ( e.g. “*.TXT” ) a folder means there'll be no
warnings for files not found there ( e.g. “No·Such·File.CPP” ).
Below, is an example ( from <A hRef="http://jeffrelf.f-m.fm/X.CPP">X.CPP, Visual C++</A> ) of how to run a DOS app
with no window popping up, ever ( output is re·directed ).
ClearScreen, SetCurrentDirectory( Home ), gDate(0);
LnP Result·TXT = L"Bac\\Result.TXT", Result·ZIP = _T, Command·Line = _T ;
Command·Line += Str( Result·ZIP, L"Bac\\%d_%s·%d.ZIP", Year, Month, Day ) + 2 ;
// Backup·TXT has my list of files to backup,
// one per line, in UTF·8; the UTF·8 sig isn't allowed.
Str( Command·Line, L"7z A -sccUTF-8 -ssw %s @%s", Result·ZIP, Backup·TXT );
PROCESS_INFORMATION Stat = {}; STARTUPINFO SU ={ sizeof( STARTUPINFO ) };
SECURITY_ATTRIBUTES Inherit = { sizeof( SECURITY_ATTRIBUTES ) };
// Can't use fopen(), “bInheritHandle” must be “true”.
Inherit.bInheritHandle = 1 ;
SU.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW,
// Here, “SW_HIDE” means the window never appears, not for an instant.
SU.wShowWindow = SW_HIDE ;
// Result·TXT will have 7Zip's results, in UTF·8(no sig),
// including warnings.
SU.hStdOutput = CreateFile( Result·TXT, GENERIC_WRITE, 0, &Inherit, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 );
if ( !CreateProcess( 0, Command·Line, 0,0,1,0,0,0, &SU , &Stat ) )
Sh( L"“ %s ” Failed.", Command·Line );
else WaitForSingleObject( Stat.hProcess, INFINITE ),
CloseHandle( Stat.hProcess ), CloseHandle( Stat.hThread );
CloseHandle( SU.hStdOutput );
FILE *fp = fopen( Result·TXT, L"rb" );
if ( !fp ) Sh( L"“ %s ” didn't open(Read).", Result·TXT );
else {
// “_T” is large ( 1,600 bytes ), “B·Sh·” is huge ( 512 * 1024 bytes ).
_Sz = fread( _B = _LnP( B·Sh· ), 1, filelength( fileno( fp ) ), fp ),
fclose( fp );
_E = _B + _Sz, *_E = 0, B = P = LnP( _E + ( int( _E ) & 1 ) + 4 );
// Make it(Result·TXT) UTF·16
Sz = MultiByteToWideChar( CP_UTF8, 0, __LnP( _B ), -1, B, mxWcharSh );
E = B + Sz, *E = 0 ;
while( P = Find( 0, B = P ), *P++ = 0, Ch·Found ) { While( Ch <=32 );
if ( D = Pat·In·Str( L" WARNING:", B ) )
// Announce the warnings, nothing else.
D -= LenPat + 3, *D = 0, Sh( L"“ %s ” didn't open(Read).", B ); }
Sh( L"“ %s ” updated.", Result·ZIP ); }
SetCurrentDirectory( X·Dir ); goto nxEvent ;
Technical Details
Message-ID:
<JeffRelf.F-M.FM.Sk@2010_Jul16.8.35pm>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!news.glorb.com!news-spur1.glorb.com!newsread.glorb.com!.POSTED!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <JeffRelf.F-M.FM.Sk@2010_Jul16.8.35pm> Subject: -- Date: Sat, 17 Jul 2010 03:35:42 +0000 From: Unknown <anon@nohost.local> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!news.glorb.com!news-spur1.glorb.com!newsread.glorb.com!.POSTED!not-for-mail Newsgroups: news.software.readers Organization: JeffRelf.F-M.FM Lines: 58 NNTP-Posting-Host: XJGH+5GM8EvggnDfgIBqtQ.133.posting.glorb.com Content-Type: Text/HTML; charset=UTF-8 X-Complaints-To: abuse@glorb.com NNTP-Posting-Date: Sat, 17 Jul 2010 03:35:43 +0000 (UTC) User-Agent: JeffRelf.F-M.FM/X.EXE X-Notice: Scanned by Mr. Bill