Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

xp_read_file question

2 posts in General Discussion Last posting was on 2007-02-22 21:40:10.0Z
Dave Westphal Posted on 2007-02-22 17:31:02.0Z
From: "Dave Westphal" <Dave_Westphal@aal.org>
Newsgroups: ianywhere.public.general
Subject: xp_read_file question
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3028
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: xbonat.thrivent.com
X-Original-NNTP-Posting-Host: xbonat.thrivent.com
Message-ID: <45ddd356$1@forums-1-dub>
Date: 22 Feb 2007 09:31:02 -0800
X-Trace: forums-1-dub 1172165462 64.214.85.60 (22 Feb 2007 09:31:02 -0800)
X-Original-Trace: 22 Feb 2007 09:31:02 -0800, xbonat.thrivent.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5854
Article PK: 1841

I am currently using ASA 9.0.2 build 3375.

I had used the xp_read_file before ( file was never empty), but ran into an
issue where the file that is on the computer is empty. I now see in the
documentation why it is returning NULL.

if xp_read_file (
'C:\DOCUME~1\ALLUSE~1\APPLIC~1\dir1\subdir\verflags\filecheck.Ver' ) is not
NULL then
message 'filecheck.ver file exists';
end if;


Do you know of a different way to check if the file filecheck.ver exists (
whether empty or not )?


Thanks in advance,
Dave


John Smirnios Posted on 2007-02-22 21:40:10.0Z
From: John Smirnios <smirnios_at_sybase.com>
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: xp_read_file question
References: <45ddd356$1@forums-1-dub>
In-Reply-To: <45ddd356$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: smirnios-pc.sybase.com
X-Original-NNTP-Posting-Host: smirnios-pc.sybase.com
Message-ID: <45de0dba$1@forums-1-dub>
Date: 22 Feb 2007 13:40:10 -0800
X-Trace: forums-1-dub 1172180410 10.25.107.241 (22 Feb 2007 13:40:10 -0800)
X-Original-Trace: 22 Feb 2007 13:40:10 -0800, smirnios-pc.sybase.com
Lines: 39
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:5855
Article PK: 1840

Actually, the 9.0.2 xp_read_file behaviour sounds like a bug to me. 10.x
returns an empty string for an empty file and I think that's reasonable.

To work around the problem, you could use xp_cmdshell to test for the
existence of a file and write something to a tempfile that you then read
with xp_read_file. Definitely hokey though...

-john.

--
John Smirnios
Senior Software Developer
iAnywhere Solutions Engineering

Whitepapers, TechDocs, bug fixes are all available through the iAnywhere
Developer Community at http://www.ianywhere.com/developer

Dave Westphal wrote:
> I am currently using ASA 9.0.2 build 3375.
>
> I had used the xp_read_file before ( file was never empty), but ran into an
> issue where the file that is on the computer is empty. I now see in the
> documentation why it is returning NULL.
>
> if xp_read_file (
> 'C:\DOCUME~1\ALLUSE~1\APPLIC~1\dir1\subdir\verflags\filecheck.Ver' ) is not
> NULL then
> message 'filecheck.ver file exists';
> end if;
>
>
> Do you know of a different way to check if the file filecheck.ver exists (
> whether empty or not )?
>
>
> Thanks in advance,
> Dave
>
>