UDP improvements for the sockets module. Renamed ftpclient.fileExists to

existsFile for consistency. Added tasyncudp test.
This commit is contained in:
Dominik Picheta 2012-08-12 11:53:09 +01:00
commit e9604b4433
5 changed files with 186 additions and 26 deletions

View file

@ -227,7 +227,18 @@ proc listDirs*(ftp: var TFTPClient, dir: string = "",
ftp.deleteJob()
else: return @[]
proc fileExists*(ftp: var TFTPClient, file: string): bool =
proc fileExists*(ftp: var TFTPClient, file: string): bool {.deprecated.} =
## **Deprecated:** Please use ``existsFile``.
##
## Determines whether ``file`` exists.
##
## Warning: This function may block. Especially on directories with many
## files, because a full list of file names must be retrieved.
var files = ftp.listDirs()
for f in items(files):
if f.normalizePathSep == file.normalizePathSep: return true
proc existsFile*(ftp: var TFTPClient, file: string): bool =
## Determines whether ``file`` exists.
##
## Warning: This function may block. Especially on directories with many