You can use 'lsof' to do it and probably that's the same scheme which is used by Puppy.
But you have to know that it is still not 100% safe. Because a file system allows concurrent access, at one moment your check says the file is not opened, but as soon as you start the copying and deleting the copy on the ramdisk, another process starts opening it for modification or deletion. You can imagine it will result in various confusion to your file system.
AUDIO CODES MP-114 VOIP Gateway Open Box
$37.49
$7.99
$199.99
Cisco CP-8832-K9 Unified 8800 Series Conference VOIP IP Phone 1 Year Warranty
$139.00
Cisco CP-7945G VOIP Phone With Stand & Handset Business IP Phone 7945
$3.00
New Cisco 7945G IP VoIP Gigabit GIGE Telephone Phone CP-7945G -
$24.95
Yealink SIP-T41P PoE Ultra Elegant VoIP Phone
$29.95
Cisco CP-8861-K9 5-Line VoIP Business Phone w/ Stand & Handset
$24.98
Grandstream GS-HT802 2 Port Analog Telephone Adapter VoIP Phone & Device, Black
$32.00
Yealink T54W IP Phone, 16 VoIP Accounts, 4.3-Inch Color Display, USB 2.0 - Black
$90.99