Extracting data from depot files generated by Perfroce - perforce

Many years ago I had a Perforce server hosting an Unreal Engine 4 project, but it's no longer active and I unfortunately don't have access to it. All I have left are some depot folders. There's a specific folder with a bunch of FBX files that I need access to, but the file shows as a folder named something like this: file.uasset,d and file.fbx,d and within them are zip files.
Is there anyway for me to convert these folders into actual FBX files? Any tools or anything out there? Or do I need a server to upload these onto a depot for perfroce to understand what to do with them? Any help would be greatly appreciated!
I've tried opening them in Perforce without a workspace or server and there wasn't much I could do with them.

If you have the server root folder (the one with the db.* files), you may be able to start up P4D and just access the depot normally. If you have a checkpoint file, you can use that to reconstruct the db.* files.
If all you have are the depot archives, you can unzip the files inside them (using regular old gzip or similar) to retrieve the original content. E.g. if you have file.fbx,d/1.1234.gz, you can unzip that and you'll have the content of file.fbx as of change 1234. Each gzip file is a complete revision on its own; you don't need to glue them together or anything like that.
Note that without the database (the db.* files), you may not be able to put together the exact original structure of the depot; the back-end archive files don't exactly correspond to the depot layout since archive files may be "lazy copied" to multiple locations in the depot.

Related

What is the best way to extract .zip file/folder structure then commit to Github using Github API?

I'm trying to place some config files under version control using Github. The ONLY way to get these particular config files is via a GET request to the hosting server. Server responds with a .zip file.
.zip file structure looks similar to:
|-Folder1
--|-File1.json
--|-File2.json
--|-Pic1.jpg
|-Folder2
--|-File3.json
--|Folder3
----|Pic2.jpg
|-File4.json
|-File5.json
As you can see, its a mix of text and binary files. Also has a nested folder structure.
I need to:
Commit this .zip file to Github using the Github REST API (no problem there)
But BEFORE committing, how can I programmatically extract the folders and files (LEAVING THE FOLDER STRUCTURE IN PLACE)
Commit the results to Github
I've checked the question/solutions mentioned here, but they don't quite match/are a few years old.
Anyone have a workflow for doing this? I have to imagine SOMEONE has come across similar requirements.
I ended up using Power Automate to handle this.
Basically,
GET .zip file
Add it to OneDrive for Business
Extract it there (folder structure is "flattened", but luckily OneDrive "keeps" it by renaming each file)
Example: Folder1/File1.json in the .zip becomes Folder1_File1.json once extracted
When committing to Github via api, I just did a replace for the filename; INCLUDING the / as part of the path.
Example URL: https://api.github.com/repos/SeaDude/replace(items('FOR_EACH_app')?['properties']?['DisplayName'], ' ', '-')/contents/replace(items('FOR_EACH_source_file_2')?['Name'],'_','/')
Apparently, you can specify an empty (or non-empty) path as part of an API commit. If the directory is empty, Github will create it!

Xamarin ios - Include Files in IPA

I want to include some images within my ipa-File, that need to be placed into the app's documents folder. A similar request was here: Preloading Documents into iOS App. But I'm not familiar with Objective-C. I think I can do it some way in Xamarion.iOS, but the problem in my opinion is the quite large number of files (around 300MB). When I include the files within the AppRessources and copy them on startup, they exist twice on the disk. So there is no real saving...
Any other ideas, how i can include files without being stored twice?
Files that you include in studio goes into your bundle. You can only read them from your application. Modifications and removing is not possible. File that you copy from bundle into your Documents folder, can be modified or removed in Document folder. So there is no way to removing files from a bundle, even if you copy them into Document folder.
You can use on demand resources to download them later intro your app:
https://developer.xamarin.com/guides/ios/tvos/application-fundamentals/resources-data-storage/#On-Demand-Resources

Hiding folders in XAP file

As we know, we can see the contents of a XAP file by renaming it to .zip and opening it by any zip tool.
I would like to know if there is anyway to make the files/folders in the XAP file hidden?
i.e. If a person renames the XAP file to .zip and uncompresses the zip file to see the contents, that particular file/folder needs to stay "hidden." This is a requirement in my project.
Yes, the user may see the file/folder if he/she has selected "Show hidden folders, files, and drives" in Folder Options.
Unzip the archive into a folder
Hide several of the files/folders using the methodology your OS provides
Zip the folder back into an archive
Rename back to XAP
Be aware that this is an extremely weak protection for your contents.

Linux SVN recover files

A recent update over unversioned directories removed a bunch of files. Is there a way I can manually recover these lost files?
P.S. I cannot recover them from subversion, as the files I am looking for were never committed to SVN control. I have looked in the linux trash folder, which only contains files which have been manually deleted.
edit: Actually, the files were lost through an accidental svn rm operation. Unfortunately I cannot use revert as the files I am trying to recover were newly created and not under version control yet. Any ideas?
If files were lost during a svn update operation, there's not a lot you can do. I would suggest looking for hidden backup files that your editor may have created (in the directory where the file originally was or in the editor's temporary directory).
If you remember the name of one of the files, you can try using find to see if there's a backup copy of it somewhere on the disk.

How do I delete a file from depot, but leave local copy in tact?

I'm trying to learn Perforce and want to delete a file from the depot(easy to do with p4 delete, p4 submit), but that deletes it from the client machine dir structure as well. I want to keep my local file in my directory intact.
The only way I can see to do this would be to move it out of the hierarchy that is under Perforce control before deleting. I was able to get my file back by syncing an earlier version.
Maybe I set up my client workspace wrong? Or am I misunderstanding a fundamental concept of source control? The client workspace is /home/user and I did it this way so I could add any file under my home directory without getting an error about the file not being under client's root.
FYI - Linux client and server running P4D/LINUX26X86/2009.1/222893 (2009/11/12)
Any advice appreciated.
Thanks.
There is a way to do this, by going behind Perforce's back. Do the following:
Rename the file you want to delete to something new
Run p4 delete on the original filename
p4 submit the change
Rename the file back to the original name
I don't believe there is any way to keep a file you are deleting under Perforce. There is good reason for this, as if the file is deleted in the depot there is no reason (from a source code control perspective) to keep a copy in the client workspace.
I suspect the issue is the way you are using Perforce.
From what you have written it seems that you are using Perforce to backup/track files in your home directory structure. So the way you are using Perforce the "master" is in your home directory and the "copies" are in the depot.
This is not the intended use of a source control system as I understand it.
The master copy of all files are actually what is in the depot. From the depot, multiple clients (views) are made for purposes such as making changes, testing, and so on. The clients are transitory and can be created and deleted as required.
To do what you want to do you may need to rethink how you are using Perforce.
some of the other commands take a parameter that lets you fake the action, but delete doesn't. You could always make a new client, do the delete in that workspace.
In the Workspace tab go to folder containing file(s) to remove from source
Right-click on that directory (or from File menu) and choose Open command window here
Note - If you open your own command prompt in the source directory you may encounter this error:
"Client 'your-client' unknown - use 'client' command to create it."
Enter command p4 delete -k <file_to_delete>
Change will be added to your P4V Helix changelist ready to check in

Resources