Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file.exists = false

Status
Not open for further replies.

johnrowse

Technical User
Aug 7, 2013
14
GB
Hi

I have the following in my smart device app, but I don't understand why file.exists() returns false, despite the fact that the app can read the file without issue (so the app can find it, and even access it), if I comment out the 'exists check' beforehand...

Code:
If Not File.Exists(LocalUpdatePath & UpdateInstructionFileName) Then
            Return False
Else
       'do read
End If

Any help or advice, will be much appreciated.

Thanks

John
 
Do:
[tt]
Debug.Print LocalUpdatePath & UpdateInstructionFileName
[/tt]
and see what it shows.

Just a guess here, you may have missing
[tt]
Debug.Print LocalUpdatePath [red]& "\" &[/red] UpdateInstructionFileName
[/tt]


Have fun.

---- Andy
 
Andrzejek, Thanks for you help.

You were not far off, I have only just figured it out so had not had a chance to update y own question (although I still don't understand the difference).

I had:

"\\" & LocalUpdatePath & "\" & UpdateInstructionFileName
(as smart devices have an unnamed device folder, which you can see when you use windows explorer). For some reason the stream reader/writer class acknowledges this, but the file class does not. Luckily the stream reader class does not need this, so I can just omit completely, without worrying about both cases.

Hope this helps someone else. If someone knows why, I would love to know.

Thanks again for your help , Andrzejek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top