December 15, 2006, 10:20 AM
AdriModify with no write permission to directory containing .FOC to be modified
Using Webfocus 5.3.2 self service;
when a user runs a FEX to modify a focus database, and the focus database is in a directory that the user has only read access to; focus creates a new .FOC in the temp directory (edatemp) where the user has write access, and the modify updates this new database.
This seems to me like a big bug, has anyone encountered this problem? do you have a work around, like some type of & message that can be queried? Any suggestions?
December 15, 2006, 10:23 AM
Carol DobsonDo you have a USE statement?
If so, does it have NEW ?
USE
location\filename.foc NEW
END
A little more info would be helpful.
Thanks
December 15, 2006, 10:59 AM
AdriI'm not using USE, the .FOC is in a directory in the path. For users with write access to the directory the modify update the .foc in the path; for users with no write access, a new .foc is creating in the temp directory.
December 15, 2006, 11:13 AM
susannahsounds to me like its working absolutely perfectly. If by 'temp dir' you mean the agent,
then at the end of the update process, query the existence of the .foc in that user's agent dir, (we don't know your platform ), if you're in win then CMD STATE agent\filename.FOC
and query the &RETCODE, and branch accordingly.
Get the agent name using the TEMPPATH function.
If by 'temp dir' you don't mean the agent, then you know where your TEMPDIR is set..so checking the existence of the .foc will be easier.
If everyone shares the same explicit TEMPDIR then you do have a problem, but its not a bug. You can reset the TEMPDIR to the users own agent, much safer, i do it all the time for my REMOTE calls, where an explicit TEMPDIR is required.
If you're relying on the path to locate the file, then its working exactly as you would want it to. WYCIWYG. Otherwise you need to do what Carol has already suggested, and explictly declare a USE to point to the proper file. and if the user can't update it, then see what kind of error message you get.
December 15, 2006, 11:15 AM
Carol DobsonTry adding the USE statement. All MODIFY's should have a USE statement.
Of course, if the user doesn't have access, the request should fail.
Let us know!
December 15, 2006, 12:01 PM
AdriYou are correct the USE statement will fix the problem.
What confused me is that when I issue a MODIFY if I have access to write to the file, it used the file in the path, but if I don't have access it creates a new one.
I guess we should always use the USE command when modifing.
thanks for your help
A.
December 15, 2006, 12:20 PM
Tony AAdri,
Get into the habit of using it always, even when reporting as then you'll know where the data is definitely coming from / going to!
Control the machine don't let it control you.
T
December 15, 2006, 01:54 PM
Adrigreat advise !
A.
December 15, 2006, 02:52 PM
Carol DobsonAnother handy commend is WHENCE
WHENCE focusfile FOCUS
where:
focusfile
Is a FOCUS data source.
This will show you the location of the file that's being used quickly!
December 15, 2006, 03:37 PM
AdriI guess you're suggesting that we should not rely on path to find a data file, but should always explicitly reference it with use.
Can the output of the whence command be captured?
December 15, 2006, 04:36 PM
Carol DobsonLike Tony A said, you should always use the USE command.
And, you can only capture it with a cut/paste - from looking at the echo.
Look up the WHENCE command, it's helpful.
-DEFAULT &ECHO=ALL;