I have checked out few files on the perforce client. I can get the list of those files by command 'p4 opened' It gives path in the form of //depot/... like I want to know how this can be converted to path on the local path(I mean client path) So that i can create a batch file to backup those just before end of the Day Thanks In advance Uday
9 Answers
You can use p4 where to convert depot filespecs into local filespecs.
To parse the output of p4 where from a Windows batch file, something like the following might help:
for /f "tokens=3" %%i in ('p4 where %my_depot_filespec%') do echo %%i
Note that the body of the for-loop may execute more than once for more complex mappings, such as the ones described in the p4 where documentation. If you need to handle those, you might need to do more complicated parsing.
You also might want to consider why you feel the need to back up files at the end of each day oustide of using Perforce itself.
You may find that using a development branch and submitting the changes (with the "reopen for edit" flag checked) at the end of each day is actually easier and better. For a start, you are then using Perforce to keep track of your changes, rather than your own manual system.
Using a development branch means that you can do these checkins without risk of messing up your workmates.
Just a suggestion worth considering, that's all.
FYI, as of v2012/2013, you'd be better off using Perforce's shelving feature for your daily backup operation. Other users in your team would then be able to access these shelves as well. Using it for backup this way prevents your history from being polluted by intermediate file variants that you don't really care about (or portions of which are not appropriate for checkin).