EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SFTP File Exists

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
Posted: 02/07/2007 17:28:15
by M Blake (Basic support level)
Joined: 02/07/2007
Posts: 2

I have just started using this product and am very happy. I'm doing C# web project in VS2005 and I was able to get encryption and SFTP to work fine.

Now I am looking to implement/find a FileExists method in the SFTP stuff that return true/false when I pass a file name. I am working in SBSimpleSftp. Please reply if you have input. Thanks!!!
Posted: 02/08/2007 01:05:11
by Eugene Mayevski (EldoS Corp.)

Windows (and most likely Unix) file APIs don't implement FileExists functions. So does SFTP. You have several options:
1) attempt to open the file for reading and analyze the error code
2) read the directory (you will need to read the whole directory, as ReadDirectory doesn't support file masks) and check the file names
3) request file attributes. This should work best of all.

Sincerely yours
Eugene Mayevski
Posted: 02/08/2007 01:06:07
by Eugene Mayevski (EldoS Corp.)

I've added an item to ToDo list to implement FileExists using attribute requests.

Sincerely yours
Eugene Mayevski
Posted: 02/08/2007 08:21:00
by M Blake (Basic support level)
Joined: 02/07/2007
Posts: 2

Thanks for the input. I thought I was missing something when I couldn't find FileExists(). I'll just call Open method and check for error. Thanks again!



Topic viewed 2545 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!