<p>I'm trying to figure out a way to detect files that are not opened for editing but have nevertheless been modified locally. <code>p4 fstat</code> returns a value <code>headModTime</code> for any given file, but this is the change time in the depot, which should not be equal to the filesystem's <code>stat</code> last modified time.</p>

<p>I'm hoping that there exists a more lightweight operation than backing up the original file, forcing a sync of the file, and then running a diff. Ideas?</p>

From:
http://answers.perforce.com/articles/KB/3481/?q=disconnected&l=en_US&fs=Search&pn=1
See step 2 specifically:
2 . Next, open for "edit" any files that have changed:
```
```
p4 diff -se //myclient/... | p4 -x - edit
```
```
p4 diff -se returns the names of depot files whose corresponding client file differs in any way from the clients #have revision.