Check if file exists

Mar 17, 2011 at 3:48 AM

How would I go about checking if a file exists? Before I would use the code: 

using System;
using System.IO;

if (file.exists(@"/test.txt))
{
    Console.WriteLine("exists");
}
else
{
    Console.WriteLine("doesn't exist");
}

But this code doesn't work within Cosmos. Is there another way to check if a specified file exists?

 

Coordinator
Mar 17, 2011 at 9:05 AM
What version of cosmos are you using?

On Thu, Mar 17, 2011 at 3:48 AM, ieatlotz <notifications@codeplex.com> wrote:

From: ieatlotz

How would I go about checking if a file exists? Before I would use the code:

using System;
using System.IO;

if (file.exists(@"/test.txt))
{
    Console.WriteLine("exists");
}
else
{
    Console.WriteLine("doesn't exist");
}

But this code doesn't work within Cosmos. Is there another way to check if a specified file exists?

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Coordinator
Mar 17, 2011 at 1:43 PM
> How would I go about checking if a file exists? Before I would use the
> code:

Until filesystems are completed, this code wont work.