Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

idan357

Re: Using Directory.Exists allways give "false"

idan357 wrote:

Hello all,

Im using "Directory.Exists" to verify if a folder exist and if not im crating it.

My problem is the the "Directory.Exists" is always false.
i want to verify "myfolder"
bool FolderExist= Directory.Exists("/folder1/folder2/myfolder");


im using SCP protocol and
session.ExecuteCommand("mkdir /folder1/folder2/myfolder")
to crate it later in the code and it works with no problem.

But still "Directory.Exists" is always false.
What am i missing here ?


BR,
Idan


Using
RemoteDirectoryInfo info1 = session.ListDirectory("/folder1/folder2/myfolder")
shows the directory info and the number of files under it.
idan357

Using Directory.Exists allways give "false"

Hello all,

Im using "Directory.Exists" to verify if a folder exist and if not im crating it.

My problem is the the "Directory.Exists" is always false.
i want to verify "myfolder"
bool FolderExist= Directory.Exists("/folder1/folder2/myfolder");


im using SCP protocol and
session.ExecuteCommand("mkdir /folder1/folder2/myfolder")
to crate it later in the code and it works with no problem.

But still "Directory.Exists" is always false.
What am i missing here ?


BR,
Idan