[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: http_parse_xml_stmf issue



Yes they are an issue.

To reiterate Thomas' point:

D pefile s 20a inz

Because pefile is not defined with varying, it _always_ contains 20
characters. When initialized it has 20 blanks. When the value is set to
"testfile.xml", it contains "testfile.xml        ". In order to "remove"
the trailing blanks, you must use %trim(pefile) or %trimr(pefile). As
Mike said, "testfile.xml        " is a valid filename in the IFS.

D pefile s 20a inz varying

Now the RPG program internally tracks now many of the 20 positions are
used on variable assignment. Setting pefile to "testfile.xml" now
results in pefile using 12 positions "testfile.xml". You can still force
trailing blanks, so you could set pefile to "testfile.xml " (13
positions used) or "testfile.xml        " (20 positions used). When used
properly, a varying field eliminates the need to use %trim or %trimr to
manage trailing blanks.

To summarize, the IFS considers "testfile.xml", "testfile.xml " and
"testfile.xml        " as three different files.

--Loyd

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mohamed
Musthafa Safarulla
Sent: Tuesday, January 05, 2010 11:00 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: http_parse_xml_stmf issue

Trailing blanks shouldnt be an issue, right? my xml name was
"testfile.xml        "

Thanks,
Musthafa

On Tue, Jan 5, 2010 at 6:06 PM, Mike Krebs
<mkrebs@xxxxxxxxxxxxxxxxxx>wrote:

> Spaces are valid characters in filenames in most of the IFS. That is 
> why they are significant. Most GUIs will remove trailing spaces, but 
> command line will sometimes let you put them in. Makes it hard to get 
> rid of them when you can't "see" what they really are.
>
> If this was a QSYS file name, the name would be invalid.
>
> Mike Krebs

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------