mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 16:23:01 +00:00
Check for presence of directory
svn path=/trunk/; revision=19527
This commit is contained in:
parent
51c3c77902
commit
e0c1c5a1df
2 changed files with 16 additions and 2 deletions
|
@ -355,6 +355,20 @@ namespace ReactOS.CustomRevisionAction
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool DirectoryExists(string directory)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ChangeDir(directory);
|
||||||
|
ChangeDir("..");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (FtpException)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Return the size of a file.
|
/// Return the size of a file.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -193,7 +193,7 @@ namespace ReactOS.CustomRevisionAction
|
||||||
if (directory != "")
|
if (directory != "")
|
||||||
ftpClient.ChangeDir(directory);
|
ftpClient.ChangeDir(directory);
|
||||||
/* Create destination directory if it does not already exist */
|
/* Create destination directory if it does not already exist */
|
||||||
if (ftpClient.GetFileList(branch).Length < 1)
|
if (!ftpClient.DirectoryExists(branch))
|
||||||
ftpClient.MakeDir(branch);
|
ftpClient.MakeDir(branch);
|
||||||
ftpClient.ChangeDir(branch);
|
ftpClient.ChangeDir(branch);
|
||||||
ftpClient.Upload(sourceFilename);
|
ftpClient.Upload(sourceFilename);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue