Topic "how can I make sure whether the directory is exit or not"

Author Message
xxkwanglei
[View user's profile]

Joined: 2013-09-13
Posts: 2
Location: zhejiang.china
in .NET C#
before using seesion.CreatDirectory("PATH") to create directory,I want to make sure whether the directory is exit or not?
how can I do?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
Use Session.FileExists:
https://winscp.net/eng/docs/library_session_fileexists
xxkwanglei
[View user's profile]

Joined: 2013-09-13
Posts: 2
Location: zhejiang.china
thanks
the example shows whether a file in the directory or not, my question is how can I make sure whether the directory is exit or not,if the directory is not exit ,I have to create it before put files in the directory.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
xxkwanglei wrote:
thanks
the example shows whether a file in the directory or not, my question is how can I make sure whether the directory is exit or not,if the directory is not exit ,I have to create it before put files in the directory.

I'm not sure if understand your problem. Anyway, note the the method works for directories too.
mrstone
[View user's profile]

Joined: 2015-09-04
Posts: 2
Location: 377-53,Shindang dong, Jung-Gu, Seoul, Korea
You mean exist directory

isn't it?
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License