[SparForte][Banner]
[Top Main Menu] Intro | Tutorials | Reference | Packages | Examples | Contributors   [Back Page]      [Next Page]  

Lock_Files Package

A lock file is a file that, if it exists, indicates that a particular resource is in use. The lock_files package contains procedures to create and destroy lock files under any operating system. If a lock file cannot be locked, an error is reported.

GCC Ada Equivalent: GNAT.Lock_Files
 

lock_files.lock_file( [dir,] file, [, wait [, retries] ] )

 

Create a lock file named file in directory dir. Retry up to retries (natural) times, waiting for wait (duration) seconds between retries. Default for wait/retries in 1.0 second and almost forever.

Example

lock_files.lock_file( "test_lock.lck" );

Parameters

Param Mode Type Default Description
dir in string "." the directory to place the lock file in
file in string required the name of the lock file
wait in duration 1.0 the number of seconds to wait between retries
retries in natural largest natural the maximum number of retries

Exceptions

If the file cannot be locked, SparForte reports an error.

See Also

lock_files.unlock_file

Compare With

Ada: GNAT.Lock_Files.Lock_File

lock_files.unlock_file( [dir,] file )

 

Delete the lock file named file in directory dir.

Example

lock_files.unlock_file( "test_lock.lck" );

Parameters

Param Mode Type Default Description
dir in string "." the directory the lock file is in
file in string required the name of the lock file

Exceptions

-

See Also

lock_files.lock_file

Compare With

Ada: GNAT.Lock_Files.Unlock_File

 
[Right Submenu]

 Summary

 arrays

 btree_io

 calendar

 cgi

 chains

 command_line

 db/ postgresql

 dbm

 directory_operations

 doubly_linked...

 dynamic_hash_...

 enums

 exceptions

 files

 gnat.cgi

 gnat.crc32

 hash_io

 lock_files

 memcache

 memcache.highread

 mysql

 mysqlm

 numerics

 os

 pen

 pen (OpenGL)

 records

 sound

 source_info

 stats

 strings

 System

 teams

 templates

 text_io

 units

[Back to Top] Back To Top [Small Forte Symbol]