Cr07&Lm10
31st May 2015, 06:51
Hello Expert,

I need a help. I have a input field in which user is inputting a file name along with the folder for example "D:\user\data.txt". Is there any function to check if that file along with the folder exist in the local machine or not.

Kindly advice and help.

Thanks in advance
Saikat

bhushanchanda
31st May 2015, 11:51
Hi,

Use seq.fstat.local() to check that.

e.g

long len.in.bytes
seq.fstat.local("C:\Program Files\Test.txt", len.in.bytes)
if len.in.bytes <= 0 then
message("File Doesn't Exists")
endif

Note, you need to include - #include <bic_desktop> in your script declaration.

bdittmar
31st May 2015, 11:52
Hello,

for example use :

function string get.local.filename ()

Regards

Cr07&Lm10
31st May 2015, 12:43
Hello Bhusan,

Thanks for your help. I am getting the error "Fatal Error: Can't open input file '${BSE_REM}!${BSE}/include6.2/bic_desktop". Kindly advice

bhushanchanda
31st May 2015, 12:48
Hi,

Its because you are on an older porting set.

Try using this instead -

#pragma used dll "ottdllbw"

e.g.

declaration:
#pragma used dll "ottdllbw"
function main()
{
long len.in.byt
seq.fstat.local("C:\Bhush\Test.txt", len.in.byt)
if len.in.byt <= 0 then
message("File Doesn't Exists")
endif
}