Check file whether exists or not

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Check file whether exists or not

Post by alemrantareq » Wed Nov 05, 2008 10:32 am

Hi everybody, i want to check a file named "MyFile.txt" in windows directory before my application open. If that file exists, my app will run; otherwise it will exit showing a message. Can anybody tell me that script in simple? Thanks ...

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Wed Nov 05, 2008 10:55 am

Dear alemrantareq,

Code: Select all

if there is a file <path to file> then...
Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Re: Check file whether exists or not

Post by alemrantareq » Sun Jan 20, 2013 3:38 pm

hello everyone, i need to check a file exists or not on a server. I've tried several function & command but dont understand how to cook them properly. Can anyone teach me whats the exact command to check a server file existance?

The command will be - if the file exists, it will ask to download :)

I've found some examples in this forum; but all r ftp based, I mean to get a file I need to know username & pass. But I'm talking about downloading from a direct link. & the file is in rar format.

replies r most appreciated :)
Last edited by alemrantareq on Sun Jan 20, 2013 4:04 pm, edited 1 time in total.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Check file whether exists or not

Post by Mark » Sun Jan 20, 2013 4:03 pm

Hi,

I wonder if my previous reply was useful?

Since this is a very old thread about a different subject, it is better to start a new thread.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Re: Check file whether exists or not

Post by alemrantareq » Sun Jan 20, 2013 4:05 pm

tnx Mark, u were always with me to help...btw, I've modified my psoting. pls take a look. :)

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Check file whether exists or not

Post by Mark » Sun Jan 20, 2013 4:50 pm

Hi,

Just download the file and check the result. I should be like this:

Code: Select all

put URL "http://ww.domain.xyz/filedoesntexist.zip" into myData
put the result into rslt
if rslt is not empty then
  beep
  answer error rslt
else
  // continue handling the data
end if
I still think it would have been better to start a completely new thread.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

alemrantareq
Posts: 203
Joined: Wed Jul 23, 2008 8:46 am

Re: Check file whether exists or not

Post by alemrantareq » Sun Jan 20, 2013 5:26 pm

tnx dear, I've checked the script; but it's not working. I mean it doesn't get the file existence. Well I'm creating a new thread. :)

Post Reply