 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Lee Hudspeth
Joined: 07 Sep 2000 Posts: 8
|
|
boolean reversed? |
|
Help! Something very strange has happened to some of my scripts. It appears that when I use the notfileexists or fileexists commands I am getting the opposite value of what is true but only for a specific file name "nsale800.rec". All other file names are functioning correctly with these commands. I wrote the following test program after narrowing down the problem to confirm what is being reported by the commands. None of the file names listed in the script really exist. But when I run the script, for the file "nsale800.rec" the notfileexists command returns FALSE and the file exits command returns TRUE. The other file names get a return value that is correct. I'm running NT4sp5. I've upgraded to 24x7v240. Same symptoms. I uninstalled and installed the full 24x7v240. Same symptoms. It's like that file name is stuck somewhere and won't clear. Here's the test program I used: //test program dim file1, string, "test.rec" dim file2, string, "ntest.rec" dim file3, string, "nsale800.rec" dim notthere1, boolean dim there1, boolean dim notthere2, boolean dim there2, boolean dim notthere3, boolean dim there3, boolean cd("d:\\iftpsvc\\dms-transfer1\\users\\testuser\\") notfileexists(file1, notthere1) messagebox(notthere1) notfileexists(file2, notthere2) messagebox(notthere2) notfileexists(file3, notthere3) messagebox(notthere3) fileexists(file1, there1) messagebox(there1) fileexists(file2, there2) messagebox(there2) fileexists(file3, there3) messagebox(there3)
|
|
Wed Nov 15, 2000 2:37 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
Re: boolean reversed? |
|
Could it be that the file nsale800.rec is system or hidden and you don't see it in the File Explorer, but the file does exist? : Help! Something very strange has happened to some of my scripts. It appears : that when I use the notfileexists or fileexists commands I am getting the : opposite value of what is true but only for a specific file name : "nsale800.rec". All other file names are functioning correctly : with these commands. I wrote the following test program after narrowing : down the problem to confirm what is being reported by the commands. None : of the file names listed in the script really exist. But when I run the : script, for the file "nsale800.rec" the notfileexists command : returns FALSE and the file exits command returns TRUE. The other file : names get a return value that is correct. : I'm running NT4sp5. I've upgraded to 24x7v240. Same symptoms. I uninstalled : and installed the full 24x7v240. Same symptoms. It's like that file name : is stuck somewhere and won't clear. Here's the test program I used: //test : program : dim file1, string, "test.rec" : dim file2, string, "ntest.rec" : dim file3, string, "nsale800.rec" : dim notthere1, boolean : dim there1, boolean : dim notthere2, boolean : dim there2, boolean : dim notthere3, boolean : dim there3, boolean : cd("d:\\iftpsvc\\dms-transfer1\\users\\testuser\\") : notfileexists(file1, notthere1) : messagebox(notthere1) : notfileexists(file2, notthere2) : messagebox(notthere2) : notfileexists(file3, notthere3) : messagebox(notthere3) : fileexists(file1, there1) : messagebox(there1) : fileexists(file2, there2) : messagebox(there2) : fileexists(file3, there3) : messagebox(there3)
|
|
Wed Nov 15, 2000 4:10 pm |
|
 |
Lee Hudspeth
Joined: 07 Sep 2000 Posts: 8
|
|
Re: boolean reversed? |
|
No, the file definitely does not exist. I've also tried the job with other directories and get the same result. : Could it be that the file nsale800.rec is system or hidden and you don't see : it in the File Explorer, but the file does exist?
|
|
Wed Nov 15, 2000 5:19 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
Re: boolean reversed? |
|
Ther is no magic and it works for one file it will work for another file You are missing something! Are you sure that cd("d:\\iftpsvc\\dms-transfer1\\users\\testuser\\") works? Note that using current directory is extremelly unrelable as it can change any second and there is no guarantee that it will be the same while script is working. Try the following: //test program dim file1, string, "d:\\iftpsvc\\dms-transfer1\\users\\testuser\\test.rec" dim file2, string, "d:\\iftpsvc\\dms-transfer1\\users\\testuser\\ntest.rec" dim file3, string, "d:\\iftpsvc\\dms-transfer1\\users\\testuser\\nsale800.rec" dim notthere1, boolean dim there1, boolean dim notthere2, boolean dim there2, boolean dim notthere3, boolean dim there3, boolean notfileexists(file1, notthere1) messagebox(notthere1) notfileexists(file2, notthere2) messagebox(notthere2) notfileexists(file3, notthere3) messagebox(notthere3) fileexists(file1, there1) messagebox(there1) fileexists(file2, there2) messagebox(there2) fileexists(file3, there3) messagebox(there3) : No, the file definitely does not exist. I've also tried the job with other : directories and get the same result.
|
|
Wed Nov 15, 2000 5:46 pm |
|
 |
Lee Hudspeth
Joined: 07 Sep 2000 Posts: 8
|
|
Re: boolean reversed? |
|
Thank you!! Yes, after plugging in the full path the result was corrected. The script was apparently finding another "nsale800.rec" file in an unrelated directory and that was messing up the logic. I will rewrite my scripts using the full path. Thanks.....Lee : Ther is no magic and it works for one file it will work for another file : You are missing something! : Are you sure that : cd("d:\\iftpsvc\\dms-transfer1\\users\\testuser\\") works? : Note that using current directory is extremelly unrelable as it can change : any second and there is no guarantee that it will be the same while script : is working.
|
|
Wed Nov 15, 2000 7:51 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|