Lines Matching defs:file
41 /** FILE LOCKS SUPPORT
44 ** writable file (e.g. the userdata.img disk images).
47 ** only if the corresponding file path could not be locked.
49 ** all file locks are automatically released and destroyed when the program exits.
50 ** the filelock_lock() function can also detect stale file locks that can linger
54 ** file - the data file accessed by the emulator
55 ** lock - a lock file (file + '.lock')
56 ** temp - a temporary file make unique with mkstemp
75 const char* file;
112 /* check to see if there is a pid file in it */
131 D( "no pid file in '%s', assuming stale directory", lock->lock );
144 D( "could not read pid file '%s'", lock->temp );
183 D( "the file '%s' is locked by process ID %d\n", lock->file, lockpid );
189 /* write our PID into the pid file */
222 FILE* f = NULL;
226 strcpy( lock->temp, lock->file );
231 D("cannot create locking temp file '%s'", lock->temp );
238 D( "cannot write to locking temp file '%s'", lock->temp);
246 D( "can't properly stat our locking temp file '%s'", lock->temp );
250 /* now attempt to link the temp file to the lock file */
259 D( "cannot acquire lock file '%s'", lock->lock );
317 /* no pid, stale if the file is older than 1 minute */
329 D("file '%s' is already in use by another process", lock->file );
372 /* create a file lock */
374 filelock_create( const char* file )
376 int file_len = strlen(file);
387 lock->file = (const char*)(lock + 1);
388 memcpy( (char*)lock->file, file, file_len+1 );
390 lock->lock = lock->file + file_len + 1;
391 memcpy( (char*)lock->lock, file, file_len+1 );