OS2 World.Com Forum
2012.05.25, 03:12:30 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Where did I get...  (Read 2106 times)
ddan
Full Member
***
Posts: 176


View Profile
« on: 2008.06.25, 18:54:54 »

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
Logged
jep
Global Moderator
Sr. Member
*****
Posts: 402


View Profile
« Reply #1 on: 2008.06.26, 09:34:51 »

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
Logged
Paul Smedley
Sr. Member
****
Posts: 316


View Profile
« Reply #2 on: 2008.06.26, 10:29:10 »

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......
Logged
ddan
Full Member
***
Posts: 176


View Profile
« Reply #3 on: 2008.06.26, 16:38:45 »

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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!