![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
have you ever required obtaining a file's NAME and PATH programmatically while using the the file-variable as the source parameter? eg. call getFilename(input:file_var, output:fullpathname) although this would be fairly trivial in virtual assembly language via chasing the information in an FCB (and would be a nice enhancement...<nudge..nudge>), i no longer play there... and today needed to come up with a solution using the existing D3 functionality and pick/basic. although i plan on posting a solution that I came up with in a day or so... it turned out being an interesting challenge, so i thought i would throw it the problem out there ahead of time for those up to a fun challenge. feel free to utilize any/all tricks available to you. this has applicability for building various state-machines (including multi-tiered debuggers... eg. debugging a server application via a browser interface)... but i won't digress. any takers? |
#3
| |||
| |||
|
|
this has applicability for building various state-machines (including multi-tiered debuggers... eg. debugging a server application via a browser interface)... but i won't digress. any takers? |
#4
| |||
| |||
|
|
have you ever required obtaining a file's NAME and PATH programmatically while using the the file-variable as the source parameter? eg. call getFilename(input:file_var, output:fullpathname) although this would be fairly trivial in virtual assembly language via chasing the information in an FCB (and would be a nice enhancement...<nudge..nudge>), i no longer play there... and today needed to come up with a solution using the existing D3 functionality and pick/basic. although i plan on posting a solution that I came up with in a day or so... it turned out being an interesting challenge, so i thought i would throw it the problem out there ahead of time for those up to a fun challenge. feel free to utilize any/all tricks available to you. this has applicability for building various state-machines (including multi-tiered debuggers... eg. debugging a server application via a browser interface)... but i won't digress. any takers? |
#5
| |||
| |||
|
#6
| |||
| |||
|
|
have you ever required obtaining a file's NAME and PATH programmatically while using the the file-variable as the source parameter? eg. call getFilename(input:file_var, output:fullpathname) |
#7
| |||
| |||
|
|
user exit 90 to get the fof item id? that only works if the file is local - it won't work for super-qs. |
#8
| |||
| |||
|
|
Here's a thought. Use SYSTEM(19) to generate a unique ID. Write an item into the file using this ID. Use READU to read in the item and lock it. Execute a LIST-LOCKS command capturing the output and analyze the Item-ID column for your ID. Get the file name from the Filename column. Delete the item from your file. |
#9
| |||
| |||
|
|
Hi Dave, Sorry, you made it too difficult to resist: have you ever required obtaining a file's NAME and PATH programmatically while using the the file-variable as the source parameter? eg. call getFilename(input:file_var, output:fullpathname) How about: fullpathname = fileinfo(file.handle, FL$PATH) plus a couple dozen other useful pieces of information directly from a file handle. A couple of these give information about alternate key indices - which actually work and won't trash your filesystem. Oops, that's openQM ... you can see more items that might be simply "wishlist" bits in other systems here: http://www.openqm.com/docs/ Tom, hi! |
#10
| |||
| |||
|
|
fortunately, you don't have to actually create an item in the file to assert an item lock, which would otherwise have unwanted side-effects within the window of using a write/delete (also having greater potential side-effects on triggers.) so i simply did a READU on a non-existent item to assert the lock, with a RELEASE when finished. |
|
i'm the first to admit the above is a cludge... but when you need the functionality... |
![]() |
| Thread Tools | |
| Display Modes | |
| |