• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

Where did I get...

Started by ddan, 2008.06.25, 18:54:54

Previous topic - Next topic

ddan

Smedley's PmW-Fx 1.5 puts download info into file EA. This is a tool I developed just now when the need (or at least interest arose in testing EAs in general with REXX, as you can get this info by splitting the EA off with EAUTIL for a one time use).

Copy/paste all below. I named it WDIG.CMD.

/* Where Did I Get... uses info Smedley's PmW-FX puts into download's EA */
/* see orexx.inf for sysgetea() doc, but it's in the "plain" rexxutil */
/* also see http://home.claranet.de/xyzzy/rxxos2eas.htm for more info */

call rxfuncadd 'sysloadfuncs', 'rexxutiil', 'sysloadfuncs'
call sysloadfuncs

parse arg fn /* seems to get all of parameter even with spaces */
say 'Where did I get: "'fn'"?' /* this shows the command line parameter */

if sysgetea(fn, '.SUBJECT', "varn") = 0 then do
  vc= translate(varn) /* case-insensitive MAY be necessary sometimes, so */
  p= pos('HTTP:/', vc) /* a copy is made for these position tests... */
  if p = 0 then p= pos('FTP:/', vc) /* probably the only two possible */
  if p > 0 then do
    varn= substr(varn, p, length(varn) - p + 1) /* all after p */
    say 'From 'varn
  end
  else say 'Apparently from nowhere...'
end

jep

Hello,

Didn't know that PMW-Fx place info like that, remember that AWGet can do it... so your script should be useful for many!

You mention that the URL start with "probably the only two possible".
would
varn = FILESPEC( 'P', vc )||FILESPEC( 'N', vc )
be useful if it start with something else?!
https://, file:///

//Jan-Erik

Paul Smedley

Quote from: ddan on 2008.06.25, 18:54:54
Smedley's PmW-Fx 1.5 puts download info into file EA.

Nothing to do with me...... That would be Peter Weilbacher's PmW-Fx......

ddan

To Smedley: whoops. You do so many ports that I got confused. Thanks for your efforts.

My thanks Peter Weilbacher, then too. By the way, I'm pretty content with version 1.5 after trying FF2 and now FF3. The latter works fine, but the fonts are fairly horrible. In particular, the menu font is a small Courier yet fewer bookmark lines are shown, and I can't figure how to change it.

To jep: hmm, for downloaded files, I don't know of any other prefix possible.

Here's the bit of code I used to see what was there (though the page mentioned doc's apparently all known types):

/* test sysqueryealist() */

/* you need rexxutil.dll; it'll be loaded if any program used it previously */

d= directory()
parse arg fn
say 'Looking for:'d||'\'||fn /* just to check that assembled to a valid path... */

call SysQueryEAList d||'\'||fn, "list."

do i = 1 to list.0
say 'Attribute' i 'is' list.i
if SysGetEA(fn, list.i, "varn") = 0 then do
  say varn
end
end