mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +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
|
@ -354,7 +354,21 @@ namespace ReactOS.CustomRevisionAction
|
|||
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
public bool DirectoryExists(string directory)
|
||||
{
|
||||
try
|
||||
{
|
||||
ChangeDir(directory);
|
||||
ChangeDir("..");
|
||||
return true;
|
||||
}
|
||||
catch (FtpException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the size of a file.
|
||||
/// </summary>
|
||||
|
|
|
@ -193,7 +193,7 @@ namespace ReactOS.CustomRevisionAction
|
|||
if (directory != "")
|
||||
ftpClient.ChangeDir(directory);
|
||||
/* Create destination directory if it does not already exist */
|
||||
if (ftpClient.GetFileList(branch).Length < 1)
|
||||
if (!ftpClient.DirectoryExists(branch))
|
||||
ftpClient.MakeDir(branch);
|
||||
ftpClient.ChangeDir(branch);
|
||||
ftpClient.Upload(sourceFilename);
|
||||
|
|
Loading…
Reference in a new issue