chirdir
GCC Consulting
gcc at optonline.net
Wed Sep 1 19:48:45 PDT 2004
I created the following test program which may not be the most efficient way to write this program. However for test purposes with the debugger, it allows me to see what is happening.
When I use getcwd() to show the directory I am in, it only show "t:/" line 18 & 30.
At line 32 when I check for the existence of the file "enter.prc" I get a false reading.
No the array displayed twice shows all of the *.prc files in the directory t:\legscene\filepro\inquire
Why isn't getcwd displaying the proper path?
Why am I getting a false when all 23 *.prc files are found but exists(file_name) is false?
Richard Kreiss
GCC Consulting
8 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: declare direct,drive,file_name
9 ------- - - - - - - - - - - - - - - - -
◄ If: 'get current directory so we can return here ?
Then: xx=getcwd()
10 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: dim my_files(50)
11 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: ct="1"
12 ------- - - - - - - - - - - - - - - - -
◄ If:
Then:
13 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: chdir "t:/legscene/filepro"
14 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: dn=opendir()
15 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: sl=listbox(@dirlist)
16 ------- - - - - - - - - - - - - - - - -
do_over◄ If: ct lt dn
Then: dm=nextdir()
17 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: zz=getcwd()
18 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: SHOW("15","15") "We are in"<zz
19 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: l(25,*)=@dirlist(ct);my_files(ct)=l
20 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: ct=ct+"1"
21 ------- - - - - - - - - - - - - - - - -
◄ If: ct le dn
Then: GOTO do_over
22 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: n=closedir()
23 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: clear my_files;zz=""
24 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: ct="1"
25 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: direct="t:/legscene/filepro/"{my_files["3"]{""
26 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: chdir direct
27 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: dn=opendir("prc_mask")
28 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: SHOW("10","15") "There are \b5"<dn<"\a- file in this directory"
29 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: zz=getcwd()
30 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: SHOW("17","15") "We are now in \b2"<zz<"\a-"
31 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: file_name="enter.prc"
32 ------- - - - - - - - - - - - - - - - -
◄ If: exists(file_name) le "0"
Then: MSGBOX ""{file_name<"not found";GOTO next
33 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: SHOW "@Going to see date";GOSUB chk_dat
34 ------- - - - - - - - - - - - - - - - -
next ◄ If:
Then: sl=listbox(@dirlist)
35 ------- - - - - - - - - - - - - - - - -
do_next◄ If: ct lt dn
Then: dm=nextdir()
36 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: l=@dirlist(ct);my_files(ct)=l
37 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: ct=ct+"1"
38 ------- - - - - - - - - - - - - - - - -
◄ If: ct le dn
Then: GOTO do_next
39 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: n=closedir()
40 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: sl=listbox(my_files)
41 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: CLS("15","6")
42 ------- - - - - - - - - - - - - - - - -
◄ If:
Then: END
More information about the Filepro-list
mailing list