DIRECTORY function won't work under NT Server 4.0 
Author Message
 DIRECTORY function won't work under NT Server 4.0

C4b,32-bit

I'm reposting this because it got buried over the weekend.  I have an app
that uses the DIRECTORY function to see if there are any files available to
import.  It works fine under Win 95 but when I put it on an NT Server
machine, the queue comes back empty.  I have tried both queue structures
mentioned in the online help.

AllFiles             QUEUE(File:queue),PRE(FIL) ! Long Filenames
                            END

AllFiles             QUEUE(ff_:queue),PRE(FIL)  ! Short Filenames
                            END

Here's my code
    if (not DownloadData) or (NextImport>Clock()) then Return.
    DIRECTORY(AllFiles,RemoteData & '\*.*',ff_:NORMAL)
    Recs = RECORDS(AllFiles)
    NextImport = Clock() + DownloadInterval*100
    if Recs>0 then
        get(AllFiles,1)
        ImportFile(FIL:name)
    end

I debugged it and found that Recs was being evaluated to 0.  Thanks-



Fri, 15 Dec 2000 03:00:00 GMT  
 DIRECTORY function won't work under NT Server 4.0

Dave,

    The only problem I can see is that the value of RemoteData. Remember, if
you are using something like...

    RemoteData = path()

... 16 and 32 bit compiled versions do and don't return the trailing backslash
respectively (I think - maybe the other way around). So, you might have your
path actually set to something like "C:\SomePlace\\*.*". Also, I'm not sure if
this attribute will accept network names (like "//JoesMachine/c:\test\*.*" -
sorry, don't know the "exact" form).

    Hope that helps. Let us know what you find out.

    Regards,

    kurtt

Quote:

> C4b,32-bit

>     if (not DownloadData) or (NextImport>Clock()) then Return.
>     DIRECTORY(AllFiles,RemoteData & '\*.*',ff_:NORMAL)
>     Recs = RECORDS(AllFiles)
>     NextImport = Clock() + DownloadInterval*100
>     if Recs>0 then
>         get(AllFiles,1)
>         ImportFile(FIL:name)
>     end

> I debugged it and found that Recs was being evaluated to 0.  Thanks-



Fri, 15 Dec 2000 03:00:00 GMT  
 DIRECTORY function won't work under NT Server 4.0

Dave,

    You still might want to double check that FILEDIALOG is consistent between
95 and NT (you might just make a variable on the screen to see it). I've heard
of stranger things!

    Regards,

    kurtt

Quote:

> RemoteData is 'c:\data' in this case.  I use FILEDIALOG with the directory
> bit set in my options window and it returns a string without the backslash.
> And, like I mentioned, it works fine under Win 95.  Both are compiled 32
> bit.  In fact, it's the same EXE.



Sat, 16 Dec 2000 03:00:00 GMT  
 DIRECTORY function won't work under NT Server 4.0

Greetings,

  You may want to check the end of the return string for the trailing slash -
Windows NT's API may not be returning the slash, and if missing you can easily
append it. I recall someone else stating this problem a little while back..

HTH,
Scott
http://hauns.com/sdaughtry.html

Quote:

> Dave,

>     You still might want to double check that FILEDIALOG is consistent between
> 95 and NT (you might just make a variable on the screen to see it). I've heard
> of stranger things!

>     Regards,

>     kurtt


> > RemoteData is 'c:\data' in this case.  I use FILEDIALOG with the directory
> > bit set in my options window and it returns a string without the backslash.
> > And, like I mentioned, it works fine under Win 95.  Both are compiled 32
> > bit.  In fact, it's the same EXE.



Sun, 17 Dec 2000 03:00:00 GMT  
 DIRECTORY function won't work under NT Server 4.0

I've posted this problem already 2 months ago, still no answer ...

I think it has something to do with the length of the LongFileName

Under WINNT 4.0 Workstation I had to define 2 queue's; 1 with the length of
LongFileName set to 256 (Queue:PDTFiles1) and another with the length of
LongFileName set to 255 (Queue:PDTFiles2).

After doing a DIRECTORY in Queue:PDTFiles1, I had to copy all
Queue:PDTFiles1 fields to Queue:PDTFiles2 (and CLIP the LongFileName); after
that I was able to see all Directory entries in Queue:PDTFiles2.

THIS IS NOT NECESSARY IN WIN95 !!!

    Relate:Parameters.Open()
    PARM:Type   = 'DIR01'
    Access:Parameters.Fetch(PARM:Parameters01)
    FREE(Queue:PDTFiles1)
    FREE(Queue:PDTFiles2)
    DIRECTORY(Queue:PDTFiles1,|
              CLIP(PARM:Directory) & '*.PDT', |
              ff_:NORMAL)
    Entries# = RECORDS(Queue:PDTFiles1)
    LOOP I# = 1 TO Entries#
        GET(Queue:PDTFiles1,I#)
            IF ERRORCODE() THEN STOP(ERROR()).
            PDTLongName2    = CLIP(PDTLongName1)
            PDTDate2        = PDTDate1
            PDTTime2        = PDTTime1
            PDTSize2        = PDTSize1
            PDTAttribute2   = PDTAttribute1
            PDTLongPathName = LONGPATH(PDTShortName1)
            ADD(Queue:PDTFiles2)
    END
    SORT(Queue:PDTFiles2, PDTDate2)

Quote:

>C4b,32-bit

>I'm reposting this because it got buried over the weekend.  I have an app
>that uses the DIRECTORY function to see if there are any files available to
>import.  It works fine under Win 95 but when I put it on an NT Server
>machine, the queue comes back empty.  I have tried both queue structures
>mentioned in the online help.

>AllFiles             QUEUE(File:queue),PRE(FIL) ! Long Filenames
>                            END

>AllFiles             QUEUE(ff_:queue),PRE(FIL)  ! Short Filenames
>                            END

>Here's my code
>    if (not DownloadData) or (NextImport>Clock()) then Return.
>    DIRECTORY(AllFiles,RemoteData & '\*.*',ff_:NORMAL)
>    Recs = RECORDS(AllFiles)
>    NextImport = Clock() + DownloadInterval*100
>    if Recs>0 then
>        get(AllFiles,1)
>        ImportFile(FIL:name)
>    end

>I debugged it and found that Recs was being evaluated to 0.  Thanks-



Tue, 19 Dec 2000 03:00:00 GMT  
 DIRECTORY function won't work under NT Server 4.0

Sorry, but I forgot to say that I'm using CW4b.

Quote:

>I've posted this problem already 2 months ago, still no answer ...

>I think it has something to do with the length of the LongFileName

>Under WINNT 4.0 Workstation I had to define 2 queue's; 1 with the length of
>LongFileName set to 256 (Queue:PDTFiles1) and another with the length of
>LongFileName set to 255 (Queue:PDTFiles2).

>After doing a DIRECTORY in Queue:PDTFiles1, I had to copy all
>Queue:PDTFiles1 fields to Queue:PDTFiles2 (and CLIP the LongFileName);
after
>that I was able to see all Directory entries in Queue:PDTFiles2.

>THIS IS NOT NECESSARY IN WIN95 !!!

>    Relate:Parameters.Open()
>    PARM:Type   = 'DIR01'
>    Access:Parameters.Fetch(PARM:Parameters01)
>    FREE(Queue:PDTFiles1)
>    FREE(Queue:PDTFiles2)
>    DIRECTORY(Queue:PDTFiles1,|
>              CLIP(PARM:Directory) & '*.PDT', |
>              ff_:NORMAL)
>    Entries# = RECORDS(Queue:PDTFiles1)
>    LOOP I# = 1 TO Entries#
>        GET(Queue:PDTFiles1,I#)
>            IF ERRORCODE() THEN STOP(ERROR()).
>            PDTLongName2    = CLIP(PDTLongName1)
>            PDTDate2        = PDTDate1
>            PDTTime2        = PDTTime1
>            PDTSize2        = PDTSize1
>            PDTAttribute2   = PDTAttribute1
>            PDTLongPathName = LONGPATH(PDTShortName1)
>            ADD(Queue:PDTFiles2)
>    END
>    SORT(Queue:PDTFiles2, PDTDate2)


>>C4b,32-bit

>>I'm reposting this because it got buried over the weekend.  I have an app
>>that uses the DIRECTORY function to see if there are any files available
to
>>import.  It works fine under Win 95 but when I put it on an NT Server
>>machine, the queue comes back empty.  I have tried both queue structures
>>mentioned in the online help.

>>AllFiles             QUEUE(File:queue),PRE(FIL) ! Long Filenames
>>                            END

>>AllFiles             QUEUE(ff_:queue),PRE(FIL)  ! Short Filenames
>>                            END

>>Here's my code
>>    if (not DownloadData) or (NextImport>Clock()) then Return.
>>    DIRECTORY(AllFiles,RemoteData & '\*.*',ff_:NORMAL)
>>    Recs = RECORDS(AllFiles)
>>    NextImport = Clock() + DownloadInterval*100
>>    if Recs>0 then
>>        get(AllFiles,1)
>>        ImportFile(FIL:name)
>>    end

>>I debugged it and found that Recs was being evaluated to 0.  Thanks-



Tue, 19 Dec 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. DIRECTORY function not working under Windows NT Server

2. Image viewing program won't work on Win NT

3. Need HELP: App too-slow on Win NT Server 4.0

4. Timing simulator for Warp 4.1 that works under Win NT 4.0

5. CFD 3.1 Int86x function not working on NT 4.0

6. Configuring PHP 4.0 for Oracle 8i on Win NT 4.0

7. VF 4.0 on Win NT 4.0...

8. WorldView 2.0 doesn't work on NT 4.0

9. Cosmo 1.0.2 doesn't work on NT 4.0

10. REXX won't execute .BAT file on NT Server

11. MS Windows NT Server 4.0, Terminal Server Edition

12. MS Windows NT Server 4.0 - Terminal Server Edition

 

 
Powered by phpBB® Forum Software