Determine if a file is open or in use or writable
is there way determine if file open in application?
possibly seeing if writable or other means?
i not want write if available write. thought maybe way detrmine if in use.
the reason want this:
i run timer in air app , if size of file opened in app has changed since time file opened ( within air ) alerts user.
however, if user not change file, timer nevers knows when turn off.
if there no way way determine if file open, take other suggestions method.
i've faced similar challenge. solution:
1. poll file changes (as3corelib has filemonitor this) , if there's change, notify user , resolve merge/conflict necessary
2. @ time of writing, if file cannot written filestream/open() throw error , can notify user , resolve problem
you poll file-lock periodically calling filestream/open() , closing, that's not idea. dealing problem when client tries write file seems best way go.
-aaron
More discussions in AIR Development
adobe
Comments
Post a Comment