Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
159 user(s) are online (140 user(s) are browsing Forums)

Members: 1
Guests: 158

jabirulo, more...

Support us!

Headlines

 
  Register To Post  

How to find all open files ?
Just can't stay away
Just can't stay away


See User information
Hi,
I'm looking for a tip using C to retrieve

-all the opened/locked files in the system (in a Dos system structure ?)
Or
-the file that a process has currently locked/opened (in an anchor in the process structure ?)

I must have made bad research but I found nothing in the autodocs and include.

Is somebody know a "simple" way to achieve this ?

Thank by advance for your help.

Go to top
Re: How to find all open files ?
Amigans Defender
Amigans Defender


See User information
There is no system API for that AFAIK. Colin Wenzel (dos.library maintainer) has some special tools to do the trick but I don't think you can do that from a generic app yet.

ExecSG Team Lead
Go to top
Re: How to find all open files ?
Just can't stay away
Just can't stay away


See User information
Thank for reply,
hoping in a next version...

Go to top
Re: How to find all open files ?
Just popping in
Just popping in


See User information
Hmmm... at least, the locks made by the dos.library should be accessible in any way, as system monitors like e.g. Scout are able to show all locks that are currently active.

So there must be some linked list to traverse and investigate...

Go to top
Re: How to find all open files ?
Quite a regular
Quite a regular


See User information
The locks are made by the filesystem, not by DOS, although the memory structures used are allocated by DOS.

Some filesystems use a linked list of Locks, but the links are unidirectional and the start of the list is not accessible, so you can only see the "downstream" part of the list, which is not exhaustive.

You will also see everyone's locks, not just your own. There is no identification of which Processes own which Locks.

Why do you want to know? What can you do with such a list? Perhaps you want a list of FileHandles, not Locks, but these are not chained together by any filesystem that I know of.




cheers
tony
Go to top
Re: How to find all open files ?
Amigans Defender
Amigans Defender


See User information
Quote:

Why do you want to know? What can you do with such a list? Perhaps you want a list of FileHandles, not Locks, but these are not chained together by any filesystem that I know of.

This is important for resource tracking and is something I'd love to know when debugging problems.

What we lack today is an API to obtain such information. Tools like Scout have to resort to nasty hacks to try and obtain this information and that should not be necessary.

ExecSG Team Lead
Go to top
Re: How to find all open files ?
Just popping in
Just popping in


See User information
@tonyw:

Thx for the clarification.

@ssolie:

Yeah, some API extensions regarding this (and other things needed for debugging) would be very nice.

Go to top
Re: How to find all open files ?
Just can't stay away
Just can't stay away


See User information
Thank you Tony for the explanations,
I wanted to use it to monitor all the files opened in the system at a precise instant.


Go to top
Re: How to find all open files ?
Just can't stay away
Just can't stay away


See User information
@zzd10h
Quote:
Thank you Tony for the explanations,
I wanted to use it to monitor all the files opened in the system at a precise instant.


Since most programs open a file, load data and close the file, you wouldn't find out much at most specific instances.

Amiga X1000 with 2GB memory & OS 4.1FE + Radeon HD 5450

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project