I have an FTP servers for me to download daily transaction files.
I was trying to do some testing to see if a particular file exist, so that I can load it to the data base.
I am using the following command:
EXEC XP_FILEEXIST 'c:\downloads\abc.txt';
where abc.txt is the file downloaded from the FTP server, through FTP Master Professional.
I got an interesting problem here. If the file is copied from somewhere else and place in c:\downloads\ , XP_FILEEXIST returns 1 (exist). However, if the file is direct FTP from the server to the download folder, the XP_FILEEXIST returns 0(not exist) instead of 1(exist) although the file is physically there!
hi RedNeckGeek , i actually started using XP_FILEEXIST after reading that article , right now I need to set the security of c:\download to be free for all, otherwise, the file status is always returned as 0