FileNumber from FileName (AREV Specific)
At 07 MAR 2003 10:07:07AM Martin Peck wrote:
Is there a way to get the O/S file number(has file)from the AREV filename?
Ex:
LIST REVMEDIA FILENO WITH FILENAME=EMPLOYEES"
(Should return 'Rev00019.lk')
Obviously this does not work but, hopefully, you get the idea. I do not care if if it is a LIST statement or a piece of code. LISTMEDIA does something similar but, as far a I know there is no way to capture the info from ListMedia in code.
Thanks in advance.
Marty Peck
At 07 MAR 2003 11:23AM Victor Engel wrote:
There are three ways.
1. If you have access to the REVMEDIA file, simply look at the record corresponding to that file. The key to the REVMEDIA file includes the account, so you would have to know the account name also (it could be a qfile or in GLOBAL account).
2. You could open the file and inspect the file handle. I won't go into further particulars here, because results will depend upon your driver. Try opening a few files and inspecting the handle yourself, and you will see pretty clearly what needs to be done.
3. Access the SYSTABLES (FILES) file. The key to this file is the name of the file you wish to query. Field 5 has the name of the DOS file. Again, the particular format for this field will depend upon your driver.
At 07 MAR 2003 11:27AM Victor Engel wrote:
I forgot to mention that for #3 (in my opinion, the most useful if you want to generate a report), the value will be empty until the file you're interested in has been accessed. Simply attaching it is not enough.
I thought of a 4th way: if you are using the NLM, you can ask the NLM directly. That is rather involved, and I don't have the steps required handy, so I'll leave that for someone else to post if they have the code at hand.
At 07 MAR 2003 06:29PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Marty -
In the SYSPROG account you can attach the revmedia for a volume and select and readnext each record in sequence. There was a tech bulletin which described this. I think it was in relation to installing MFSs.
From other AREV accounts you could OSREAD the REVMEDIA.LK and .OV - this isn't very complicated to untangle. I did it a few years back in assembler just by pure inspection. RDIR.COM You could pipe the output of this utility into a file and osread it from your program.
If you've never had to rebuild a revmedia map you're a lucky man .
Steve
World Leaders in all things RevSoft
At 08 MAR 2003 10:04AM Warren wrote:
You can always OPEN the file and parse the REVxxxxx from the file handle.
To see what I mean at TCL Type:
EVAL OPEN 'VOC' TO VOC THEN PRINT VOC
You can select the FILES/SYSTABLES file and loop through that. You'd have to add 'DICT.' to the filenames to get the dictionaries. And this will only work for ATTACHed files for the same ACCOUNT/APPLICATION
Mike Pope had one time published a utility to help rebuild the revmedia map. I tried to find a copy but was unable to. It may be on one of the utilities disks but since all my disks are on 5.25" floppies I cannot get to them easily.
At 08 MAR 2003 10:18AM Warren wrote:
Okay, it's in REVSOURCE as MAP_FIX
I also found a copy of Stephen Thomas' LHFILE from Dunbar & Assocs which gets at the media map through calls to RTP57. There's also a subroutine OPEN_MEDIA from the MFS SDK.
All of these have various ways to access the REVMEDIA files.
At 10 MAR 2003 03:07PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
I think the easiest way is
Perform "SETALIAS VOLNAME SYSPROG REVMEDIA REVMEDIA"
Name=XLate( "REVMEDIA", "File*Account", 2, 'X')
World Leaders in all Things RevSoft
At 10 MAR 2003 07:16PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Line 2 should be
Name=XLate( "REVMEDIA", "File*Account", 1, 'X')
I don't know what I was thinking….scary part is it came to me as I was driving to pick up some friends at the train station….
World Leaders in all Things RevSoft