Please help for "File open problem" 
Author Message
 Please help for "File open problem"

Hi,

I am using Clipper 5.0, after I added new files in the program, it does not
work. I try to move around the files but it does not work.

So I would like to know the max. number of handling and how can I solve the
problem.

Thanks



Fri, 07 Mar 2003 14:56:33 GMT  
 Please help for "File open problem"
On Mon, 18 Sep 2000 14:56:33 +0800, "Crazy Man"

Quote:

>I am using Clipper 5.0, after I added new files in the program,
>it does not work.

You don't say how many are being used or what operating system you
are using.

Quote:
>I try to move around the files but it does not work.

Do all the files have to be open at once? Try closing unused ones.

Quote:
>So I would like to know the max. number of handling and how can I
>solve the problem.

In the documentation supplied with Clipper 5.0 is a good place to look

   Clipper 5.0 Box, back cover.

   Clipper 5.0 Reference Manual, Work Areas, page 1-74

   Clipper 5.0 Programming and Utilities, Files and Buffers, pg 1-2

   Clipper 5.0 Programming and Utilities, The CLIPPER Environment
               Variable, pg 1-6



Fri, 07 Mar 2003 03:00:00 GMT  
 Please help for "File open problem"
A quick test to see how many files you can open on a particular PC:

nCount := 1

do while .t.
   cFile := strzero( nCount ) + '.txt'
   nHandle := fcreate( cFile )
   if nHandle == -1
      exit
   endif

   ? nCount
   nCount ++
enddo

Remember that the operating system already has some files open prior to
this running.

Hope this helps.

Sent via Deja.com http://www.deja.com/
Before you buy.



Fri, 07 Mar 2003 03:00:00 GMT  
 Please help for "File open problem"

Quote:

> A quick test to see how many files you can open on a particular PC:

> nCount := 1

> do while .t.
>    cFile := strzero( nCount ) + '.txt'
>    nHandle := fcreate( cFile )
>    if nHandle == -1
>       exit
>    endif

>    ? nCount
>    nCount ++
> enddo

Note that this:
- counts how many files you can _create_, not open; you may not be able
  to create anything, yet may be able to open files.
- does not clean up its own mess, but that's easily repaired.
- does the job on a single-user OS, but if you run several of them
  simultaneously on a multi-user OS you may get values you don't
  expect, and you're not being very nice to other processes, either.

All in all, this kind of approach (and the similar solution to "How much
memory have I got?") has some definite problems in a more-than-simple
situation, but it's probably the best solution possible; for example, if
other people can use file handles between your counting them and your
using them, there _is_ no reliable way of counting file handles.

Richard



Sat, 08 Mar 2003 03:00:00 GMT  
 Please help for "File open problem"

Quote:

> A quick test to see how many files you can open on a particular PC:

> nCount := 1

> do while .t.
>    cFile := strzero( nCount ) + '.txt'
>    nHandle := fcreate( cFile )
>    if nHandle == -1
>       exit
>    endif

>    ? nCount
>    nCount ++
> enddo

Who gets to clean up all the files this will leave kicking around the file
system? Also, do you realise that the above code will use all the remaining
file handles?

The common implementation of the above style of test opens the NUL device
multiple times and, once it has exhausted all the available handles, closes
everything it opened.

--
Take a look in Hagbard's World: |   w3ng - The WWW Norton Guide reader.
http://www.hagbard.demon.co.uk/ |     eg - Norton Guide reader for Linux.
http://www.acemake.com/hagbard/ |    weg - Norton Guide reader for Windows.
Free software, including........| dgscan - DGROUP scanner for Clipper.



Sat, 08 Mar 2003 03:00:00 GMT  
 Please help for "File open problem"
I see that I'm being spanked for:
   a.  recklessly creating files
   b.  not really addressing how many files can actually be opened
   c.  leaving a lot of trash 0*.txt files sitting in a directory

Sorry - it was just to be "A quick test".

And obviously not all inclusive to every network situation.

Sent via Deja.com http://www.deja.com/
Before you buy.



Sat, 08 Mar 2003 03:00:00 GMT  
 Please help for "File open problem"
try this from a command prompt ...

SET CLIPPER //F150

MJF

Quote:
> Hi,

> I am using Clipper 5.0, after I added new files in the program, it does
not
> work. I try to move around the files but it does not work.

> So I would like to know the max. number of handling and how can I solve
the
> problem.

> Thanks



Sat, 08 Mar 2003 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Open File As "Read Only"

2. "Too many open files" ith WinXP

3. Strange "file not open" error

4. Closing open NUL "file"?

5. debugging "Too many open files"

6. How to open files ending with ";"

7. tcl/expect "too many open file"?

8. couldn't open "evaluation.data": no such file or directory

9. Looking for "Open File" widget

10. Serious "View Open Error" problem

11. Language problem -- the "OPEN"

12. Problem with "open"...

 

 
Powered by phpBB® Forum Software