Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Win XP and Directory()
Help. An existing app that uses Directory() to get the file name(s)
form a floopy disk has stopped working since it was moved to an Xp
computer. I looked using the debugger and the function returns an
empty array.

John


Report this thread to moderator Post Follow-up to this message
Old Post
John Scott
12-09-04 08:55 PM


Re: Win XP and Directory()
On Thu, 9 Dec 2004 10:50:44 -0500, "John Scott" <jscott@kw.igs.net>
wrote:

>Help. An existing app that uses Directory() to get the file name(s)
>form a floopy disk has stopped working since it was moved to an Xp
>computer. I looked using the debugger and the function returns an
>empty array.
>

Go & grab IsFloppy() from:

http://www.witzendcs.co.uk/html/links.html

Here's what it does:

IsFloppy()

The purpose of this protected-mode safe function is to allow the
reading of floppy disks from Clipper while operating under Windows
2000 or XP.

To use the function, add the enclosed isfloppy.obj to your link script
& call the function like this:

if IsFloppy("A") // or "B" or any letter
// execute code to access floppy
else
Alert("No or unformatted floppy")
endif


Report this thread to moderator Post Follow-up to this message
Old Post
Nick Ramsay
12-09-04 08:55 PM


Re: Win XP and Directory()
I need the function to return an array containing the file names that
are on the diskette. I already have some functions for verifying the
diskett is loaded.

John

"Nick Ramsay" <news@nospam.demon.co.uk> wrote in message
 news:1vvgr0969a49reu6revh5bitbj6vk98881@
4ax.com...
> On Thu, 9 Dec 2004 10:50:44 -0500, "John Scott" <jscott@kw.igs.net>
> wrote:
> 
>
> Go & grab IsFloppy() from:
>
> http://www.witzendcs.co.uk/html/links.html
>
> Here's what it does:
>
> IsFloppy()
>
> The purpose of this protected-mode safe function is to allow the
> reading of floppy disks from Clipper while operating under Windows
> 2000 or XP.
>
> To use the function, add the enclosed isfloppy.obj to your link
> script
> & call the function like this:
>
> if IsFloppy("A") // or "B" or any letter
>   // execute code to access floppy
> else
>   Alert("No or unformatted floppy")
> endif
>


Report this thread to moderator Post Follow-up to this message
Old Post
John Scott
12-09-04 08:55 PM


Re: Win XP and Directory()
On Thu, 9 Dec 2004 14:31:12 -0500, "John Scott" <jscott@kw.igs.net>
wrote:

>I need the function to return an array containing the file names that
>are on the diskette. I already have some functions for verifying the
>diskett is loaded.

But I guess they do not work correctly. Nick's does. See below.

>
>John
>
>"Nick Ramsay" <news@nospam.demon.co.uk> wrote in message
> news:1vvgr0969a49reu6revh5bitbj6vk98881@
4ax.com... 
>

John,

With respect...read Nick's message again...and then do this..

if IsFloppy("A") // or "B" or any letter
// execute code to access floppy
aFiles := Directory("*.DBF" )  // or whatever
else
Alert("No or unformatted floppy")
endif


Regards,

Ross McKenzie
ValuSoft
Melbourne Australia

valusoft AT optushome DOT com DOT au

When there's a will, I want to be in it

Report this thread to moderator Post Follow-up to this message
Old Post
Ross McKenzie
12-10-04 01:55 AM


Re: Win XP and Directory()
My problem is not recognizing when a diskett is ready, it is when
executing the line

aFiles=Directory("a:*.*")

After this line executes the array aFiles is empty. It worked fine in
Win98 but not on an XP machine. I need a replacement for the
Directory() or ADir() functions. Niether one works in XP Pro with SP2
applied.

John

"Ross McKenzie" <NoJunk_valusoft@optushome.com.au> wrote in message
news:41b8c685.1622062@news...
> On Thu, 9 Dec 2004 14:31:12 -0500, "John Scott" <jscott@kw.igs.net>
> wrote:
> 
>
> But I guess they do not work correctly. Nick's does. See below.
> 
>
> John,
>
> With respect...read Nick's message again...and then do this..
>
> if IsFloppy("A") // or "B" or any letter
>   // execute code to access floppy
>   aFiles := Directory("*.DBF" )  // or whatever
> else
>   Alert("No or unformatted floppy")
> endif
>
>
> Regards,
>
> Ross McKenzie
> ValuSoft
> Melbourne Australia
>
> valusoft AT optushome DOT com DOT au
>
> When there's a will, I want to be in it


Report this thread to moderator Post Follow-up to this message
Old Post
John Scott
12-10-04 08:55 PM


Re: Win XP and Directory()
On Fri, 10 Dec 2004 10:46:06 -0500, "John Scott"
<jscottwithoutspam@kw.igs.net> wrote:

>My problem is not recognizing when a diskett is ready, it is when
>executing the line
>
>aFiles=Directory("a:*.*")
>
>After this line executes the array aFiles is empty. It worked fine in
>Win98 but not on an XP machine. I need a replacement for the
>Directory() or ADir() functions. Niether one works in XP Pro with SP2
>applied.
>

Sigh - yes, we know.  My function will force XP to read the contents
of the floppy instead of assuming it is empty.  You don't need to
replace anything, you just need to persuade XP to give Clipper the
contents of the directory on the floppy.  That's what IsFloppy() does.



Report this thread to moderator Post Follow-up to this message
Old Post
Nick Ramsay
12-10-04 08:55 PM


Re: Win XP and Directory()
In article <dKKdnU-3bIAiWSTcRVn-rg@igs.net>
jscottwithoutspam@kw.igs.net "John Scott" writes:

[Please don't top post...]

> My problem is not recognizing when a diskett is ready, it is when
> executing the line
>
> aFiles=Directory("a:*.*")

Perhaps the diskette is not "ready"?

> After this line executes the array aFiles is empty. It worked fine in
> Win98 but not on an XP machine. I need a replacement for the
> Directory() or ADir() functions. Niether one works in XP Pro with SP2
> applied.

I beg to differ; ADIR() works fine on the XP machines I use it on
(admittedly under S87, but I doubt that this is significant).
What I have found though is that certain diskettes that have been
written under LFN-aware versions of Windows will not be read by
DOS apps (or rather the underlying DOS service calls) as these
calls get  between LFNs and volume labels.  The diskette
gives all the signs of being "not ready".

Try a diskette that has been formatted under plain DOS and which
has only upper case, 8.3 filenames on it.

Pete
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

Report this thread to moderator Post Follow-up to this message
Old Post
pete@nospam.demon.co.uk
12-10-04 08:55 PM


Re: Win XP and Directory()
On Fri, 10 Dec 2004 17:57:28 +0000 (UTC), pete@nospam.demon.co.uk
wrote:

>In article <dKKdnU-3bIAiWSTcRVn-rg@igs.net>
>           jscottwithoutspam@kw.igs.net "John Scott" writes:
>
>[Please don't top post...]
> 
>
>Perhaps the diskette is not "ready"?
> 
>
>I beg to differ; ADIR() works fine on the XP machines I use it on
>(admittedly under S87, but I doubt that this is significant).
>What I have found though is that certain diskettes that have been
>written under LFN-aware versions of Windows will not be read by
>DOS apps (or rather the underlying DOS service calls) as these
>calls get  between LFNs and volume labels.  The diskette
>gives all the signs of being "not ready".
>

It's not quite that simple, Pete.  For some reason, Clipper 5.2x (and
maybe others) has a problem accessing the floppy in protected mode
under NT & friends.  Do you remember the old CP/M trick where you had
to do ctrl-c on a floppy to get CP/M to re-read the directory when you
changed floppies?  (Remember, hell you're probably still doing it ;-)

It's quite similar to that, only XP always insists that there's
nothing on the floppy.  What my little function does is a low-level
verify of track 1, side 1 which tests if the floppy is readable
without invoking the DOS error handler if it isn't & also has the side
benefit of making the floppy contents visible to the Clipper app.  I
suspect that directly invoking DOS int 13h does "something" to the
VDM, but I have no real evidence other than empirical.


Report this thread to moderator Post Follow-up to this message
Old Post
Nick Ramsay
12-11-04 08:55 AM


Re: Win XP and Directory()
In article <3v7lr0dkbqitk8iscg6r0dtrkq35s863hk@4ax.com>
delete-all-spam2@witzendcs.co.uk "Nick Ramsay" writes:

> On Fri, 10 Dec 2004 17:57:28 +0000 (UTC), pete@nospam.demon.co.uk
> wrote:
[..] 
>
> It's not quite that simple, Pete.

It rarely is :-(

> For some reason, Clipper 5.2x (and
> maybe others) has a problem accessing the floppy in protected mode
> under NT & friends.

Ah, so it's a pmode thing -- outside my S87 territory.  Apologies
to the OP for the bum steer.

> Do you remember the old CP/M trick where you had
> to do ctrl-c on a floppy to get CP/M to re-read the directory when you
> changed floppies?  (Remember, hell you're probably still doing it ;-)

Indeed so -- outed at last <bg>

> It's quite similar to that, only XP always insists that there's
> nothing on the floppy.  What my little function does is a low-level
> verify of track 1, side 1 which tests if the floppy is readable
> without invoking the DOS error handler if it isn't & also has the side
> benefit of making the floppy contents visible to the Clipper app.  I
> suspect that directly invoking DOS int 13h does "something" to the
> VDM, but I have no real evidence other than empirical.

Hmm -- interesting.  Don't you just hate black magic? ;-)

Pete
--
"We have not inherited the earth from our ancestors,
we have borrowed it from our descendants."

Report this thread to moderator Post Follow-up to this message
Old Post
pete@nospam.demon.co.uk
12-11-04 08:55 PM


Re: Win XP and Directory()
On Sat, 11 Dec 2004 15:05:27 +0000 (UTC), pete@nospam.demon.co.uk
wrote:

..snipped with a dead chook...
>
>Hmm -- interesting.  Don't you just hate black magic? ;-)
>
>Pete

Not if it works for you <g>.


Regards,

Ross McKenzie
ValuSoft
Melbourne Australia

valusoft AT optushome DOT com DOT au

When there's a will, I want to be in it

Report this thread to moderator Post Follow-up to this message
Old Post
Ross McKenzie
12-12-04 01:55 AM


Sponsored Links




Last Thread Next Thread Next
Pages (5): [1] 2 3 4 5 »
Search this forum -> 
Post New Thread

Clipper archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:28 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.