No one may be able to answer this, and it at least to me sounds like an incredibly stupid question, but here goes. My program gets a list of files from a remote ftp site, it saves and sorts this file list. At some later point in the program, it may be necessary to see what files have been added or deleted from the ftp sight from the original list. So the program compares the file names to a stored list, if something is changed then an update occurs. If nothing changes then no update. I use the statement

If Not client.FileExists(file_name) Then okay = False End If

The issue is when a filename has a space in it. Example Test = Test, compares fine for a file name and the program goes merrily along. T est = T est, even though it should compare fine, this always gets flagged and the program thinks something has changed unnecessarily rebuilding my list. Does anyone have any thoughts about this????

asked 26 Jul '11, 01:05

rspitzer's gravatar image

rspitzer
15
accept rate: 0%

edited 11 Oct '11, 17:11

Martin%20Vobr's gravatar image

Martin Vobr ♦♦
335310


It's only a wild guess, but maybe the FTP server is able to properly handle file upload of file with space in filename, but returns incorrect result when checking for file existence.

I would try enclosing filename with " or with '.

If Not client.FileExists("'" + filename + "'") then okay = False End If

You can also try to produce a communication log (as described at http://www.rebex.net/kb/logging.aspx) and see actual commands send and server responses when checking if the file exists. If the problem persists mail the logfile to support@rebex.net for further analysis or update your question and include relevant parts of logfile in it.

link

answered 26 Jul '11, 11:22

Martin%20Vobr's gravatar image

Martin Vobr ♦♦
335310
accept rate: 37%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×152
×13
×13

Asked: 26 Jul '11, 01:05

Seen: 745 times

Last updated: 11 Oct '11, 17:11