Operating System - OpenVMS
1745852 Members
4512 Online
108723 Solutions
New Discussion юеВ

DEC C RTL fstat(), stat(), open() and abc^.xyz.xml_res filename

 
Sepp Stadelmann
Advisor

DEC C RTL fstat(), stat(), open() and abc^.xyz.xml_res filename

The following C code out of the gnome.org's (libxml2 sources does not as it should on OpenVMS after I moved the multi dot containing files from PC to OpenVMS with FTP.

if (stat(filename, &buf) == -1)

it returns me a -1 indicating error when the filename as stored on ODS5 disk is passed as
"result/errors/attr1^.xml.err" where result is rooted system logical.

passing "result/errors/attr1.xml_res" works correctly. But I am sad to rename files because we have 1000's of it.

Which DECC$... logical do I have to enable or disable that the proper DEC C RTL routines are able to work correctly with multiple dot's in the filename and the extension?

Sepp Stadelmann

AXP1>cc/version
HP C V7.1-015 on OpenVMS Alpha V7.3-2
3 REPLIES 3
Karl Rohwedder
Honored Contributor

Re: DEC C RTL fstat(), stat(), open() and abc^.xyz.xml_res filename

A list of all DECC-logicals con be found here:

http://h71000.www7.hp.com/doc/83final/5763/5763pro_004.html#feature_logical_tab

regards Kalle
Sepp Stadelmann
Advisor

Re: DEC C RTL fstat(), stat(), open() and abc^.xyz.xml_res filename

I have found the problem!
Let me explain:

when you look first at an OpenVMS ODS5 disk using $ DIR, files with multi dots in the name and the extension are stored and presented as i.e.
DSA5:[xml.libxml2.result.errors]att1^.xml.err

please watch the carret preceding/escaping each dot but not the last one "^."

i.e. a $ copy att1.xml att1.xml.err generates the new file as att1^.xml.err

To gett proper UNIX support for such "^"'s from DECCRTL's $ Define DECC$EFS_CHARSET ENABLE and this should do the trick

However, files stored on the disk and displayed with the carret MUST NEVER BE PASSED AS ARGUMENTS WITH THE CARRET "^" to a DEC C RTL routione.

My code works now as such

if (stat(filename, &buf) == -1)

no longer returns -1 when I pass the filename as a UNIX file name with multiple dots; i.e. as "result/errors/attr1.xml.err"

an example in the reference manual could help.

But what prevented it from running before?

I did in addition $ define/sys/exec/trans=(conc,term) result dsa5:[xml.libxml2.result.]
and $ define/sys/exec/trans=(conc,term) test dsa5:[xml.libxml2.test.] where result and/or test becomes then a rooted logical and result and/or test is also found as a valid sub directory name and here, ***

NOW: I guess ***, not enabling one of the hundres of DECC$something logicals will force that a logical name translation comes first and makes the remaining UNIX support fail. I have just done $ deassigne/sys/exec test and result and passed the string with multi dost in tghe arguments.

thank you for our help
Sepp

Craig A Berry
Honored Contributor

Re: DEC C RTL fstat(), stat(), open() and abc^.xyz.xml_res filename

Not really related to your specific problem, but if you're using a rooted logical, it seems to me you'd be wanting an absolute path in UNIX syntax,

/result/errors/whatever

rather than

result/errors/whatever