Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 05:07 AM
W. Pickett
Guest
 
Posts: n/a
Default Zero-length MXL files

Hi,

I'm attempting to understand an application I may one day "inherit" in
ASP.NET and Flash. I've been searching but can't find out the answer to
this, so if you have a pointer or want to explain I'd really appreciate
it, thanks.

The site has hundreds of empty xml files in directories in different
sections named like this: section/cache/file-2005-20-09.xml. I'm sure
this is one of those "try to read xyz20050101.xml and if it doesn't exist
do this and if it does and is zero..." etc. Am I even close?

Can someone tell me something about this and does it have to do with the
server cache?


thanks in advance
  #2  
Old November 12th, 2005, 05:07 AM
Pascal Schmitt
Guest
 
Posts: n/a
Default Re: Zero-length MXL files

Hello!
[color=blue]
> The site has hundreds of empty xml files in directories in different
> sections named like this: section/cache/file-2005-20-09.xml. I'm sure
> this is one of those "try to read xyz20050101.xml and if it doesn't exist
> do this and if it does and is zero..." etc. Am I even close?[/color]

I don't know how that application uses a folder called cache - you have
to ask the creator...

You can use System.IO to check the files:

if( File.Exists( filename ) ){ // file does exist
FileStream fs = File.Open( filename );
if( fs.Length > 5 ) // file is not empty
// use the stream to create XmlTextReader or XmlDocument
else
// file is too short, likely to be empty.
}
else
// file does not exist


--
Pascal Schmitt
  #3  
Old November 12th, 2005, 05:08 AM
W. Pickett
Guest
 
Posts: n/a
Default Re: Zero-length XML files

On Tue, 27 Sep 2005 19:06:22 +0200, Pascal Schmitt wrote:
[color=blue]
> I don't know how that application uses a folder called cache - you have to
> ask the creator...[/color]

Actually my question is simpler than that: Is this guy nuts, or this a
standard way to accomplish some particular task in .NET? We may have used
zero-length files in the assembly language programming days, but it seems
like an odd way to go now, especially on a platform as powerful is this.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,248 network members.