iOS: Dumping debug data file from device to OSX - ios

I am doing a lot of DSP work on iOS
So frequently I need to dump a file of raw floats, and pick it up in something like Audacity, to look at the waveform.
Even working on the simulator, this is a PITA. I need to log the destination folder to console, open up Finder, CTRL+CMD+G, paste the destination folder, drag drop all of the files onto the desktop, open up Audacity, import them one by one manually correcting the format.
( Why can't I just point Audacity to the right folder once? because the iPhone simulator stores its data somewhere hideously deeply nested that involves a hidden folder, so I can't see it with the audacity file browser )
( Why is the format wrong? Because audacity tries to figure out the most likely format, and if my data starts off random which it often does, it will invariably get it wrong )
However, working on the device, I can't even see a way to get at these files.
What are my options? I am looking for maximum automation, as I do this typically hundreds of times in a particular job.

Related

Image.file() Showing Blank When Specified File Was Explicitly Created

In the iOS variant of my Flutter app, when I explicitly create a .jpg file using
File(path.join(filePath, fileName))
..createSync(recursive: true)
..writeAsBytesSync(buffer);
the widget that renders the file (by calling Image.file(), passing to it the file as an argument) results with a blank image.
No exception was thrown indicating that the file was not found or file contents was invalid. Its behaving as if the file is blank, but when I browse to the file using Finder, the file is there and when I click on the image, Preview renders the expected image.
When the same code is executed when the image comes from the device camera or device gallery, it works and when the same code is executed in the Android variant with the file being explicitly created, it works too.
The only thing I can think of is that it has to do with creating the image deep inside my iOS simulator directory structure
ie-/Users/joselitope/Library/Developer/CoreSimulator/Devices/F2AE8082-E670-498B-B2C6-9A83BE1855A4/data/Containers/Data/Application/7B01A347-69AE-4A1F-8567-7FCC256013F5/tmp/comp_image_cropper_2CC9EEFB-A126-4811-BD80-485B4C41F3A2-18523-00001C049E5AAE85.jpg
but again, the file is visible using Finder so this may not be the reason.
Maybe I have to set certain permissions when creating the file in iOS or perhaps settings applicable to iOS in my pubspec.yaml?
All help is greatly appreciated.
My environment is as follows:
Catelina 10.15.7,
Flutter 1.22.5 channel stable,
XCode 12.3,
Simulator: iPhone 12 Pro Max - 14.3,
Someone posted a suggestion that prompted me to look into this problem again. (That someone has since removed his suggestion so I am unable to thank him.)
Anyways, when I tried to reproduce the problem it wasnt happening anymore even in the exact use case it was happening previously.
So the question remains is why and the only thing I ruled out that it wasnt a race condition as this code has been running on Android for quite some time on various devices.
This is what I could come up with:
Knowing the filepath I was writing to, I realized that I was writing to the app's /tmp directory which iOS periodically empties out. I am thinking that I shouldn't be putting stuff there. Instead, I've been writing to the app's documents directory and it hasnt happened since.
The initial /tmp directory was chosen for me by a package I was using and since it was so long and Im new to iOS, I didn't really look into it all that much, caring only that the file was there, which it was.
Anyways, keeping my fingers crossed that the fix sticks.

need to recover trados project with translation

I was working on a language translation project in trados on a virtual machine. Half of the work was done and the translated words were exported into a Word docx file. Upon restarting the virtul machine, the project file appears to have been corrupted as trados shows no signs that the project was worked on. When I manually open the sdlproj (trados project) file, trados cannot open the file mentioning the following:
: An error occured whilst trying to determine the file version
I have tried creating a new project and used pre-translate using batch tasks but that did not seem to have imported the previously translated document. I need to figure out how to recover my project so that I can recover the translated document (so I do not have to redo the work) as well as recover the translation memory for trados. The translation memory folder is present inside the original project folder. I would really appreciate any suggestion to further troubleshoot and fix this issue. I have tried their support desk but they do not appear to be available today. Two solutions I observed from their forum suggested:
save the project file with a zip extension, extract the contents and then open the sdlxiff file from there
recreate the project and use pre-translate.
In my case, I was able to open the sdlxiff file from the translated language directory. This opened the project with the text that had previously been translated. I am not certain whether I need to remove the sdlproj file or simply save the project hoping that it will overwrite the corrupted file. In either case, I will update this post once I get an answer to that.

Convert a filetype to its original state

How can I change a file type?
A year ago I wrote a few articles that should be viewed in any text type of program. however, I recently opened them and they are viewed in symbols and alphanumeric characters. In linux os, the 'file' is now in an archived folder type that contains .xml files. in windows os it is 'file' as type of file. it has no extension.
Is there any way to recover the original readable alpha-numeric information in these files?
My preference would be to salvage the original information than redo.
First off the extension doesn't actually mean anything for the information of the file, it's only purpose is as a hint to the OS for deciding which application should be used in opening the file. You can prove this by renaming something like an exe to have a txt extension which will then open in notepad as a lot of seemingly random characters; renaming it back to exe will allow it to run again.
Based on your description the files you mention are some form of binary file, the bad news with that is you need to know either what application was used to create the file in order to be able to open it or what the original file extension was (which would be a hint to the former).
If you don't know either of those pieces of information you can of course use trial and error by guessing what extension it might be, renaming it, then opening it with the associated application and seeing if it worked.

Archive format suggestions for exporting iPad app data? Tarball?

I have an nascent iPad application, which stores "documents" internally on the device in the file system as a series of distinct files in a folder.
I'd like to try incorporating an import/export function through iTunes, using the features for OS 3.2 for this. I want to put all the document pieces that I keep internally into one container file for export.
So, smart folks of Stack Overflow: What's the simplest solution that will put a file hierarchy (or could be flat list in a pinch) into one file? There will not in theory need to be manipulation of the "archive"/container outside the app-- so random access isn't super important here, although it would be a bonus of course.
A tar file type thing springs to mind immediately. Roll my own? Any other thoughts or gotchas? (And if anyone can point me to code that reads/writes from a tar file, I'm all ears.)
Thanks!
Update: Made community wiki, since there's no single right answer here.
Try libarchive which is a friendly licensed, BSD derived (easier for iPhone OS) library for handling archive files.

BlackBerry - Unpack Zip File

I'm developing a BlackBerry application in which I need to unpack a zip file compressed with PKZIP. The package could have one file in it, or it could have 10; it will vary in each case. I know that the BlackBerry API has native support for GZip and Zlib, although I'm pretty sure that these methods aren't going to be helpful in my case. It doesn't look as if I can extract the individual files using these calls.
I've tried JZlib (http://www.jcraft.com/jzlib/), which compiled fine, but again it doesn't look as if the methods contained therein are going to allow me to pull the individual files.
It appears as if this is possible, as there's an application called Ziplorer (http://www.s4bb.com/software/ziplorer/) that claims to do perform this exact procedure. How they're doing it, however, escapes me.
So here I am after hours of Googling. I'm welcoming any insight into my problem with open arms.
"zip" algorithms are typically offshoots of the Lempel-Ziv-Welch algorithm. They are a fairly efficient stream compression algorithms, but because of how they function, you can't start to decompress at random points in the file, you have to start from the start.
Any product that claims to be able to decompress one file from a zip still has to decompress everything before it in the zip file in order to know how to decrypt the given file, or even, for that matter, where the file is in the archive.
If you can tolerate GPL code in your application, then this library http://jazzme.sourceforge.net/ that might work. However the project (and its parent project http://sourceforge.net/projects/jazzlib/) don't look like they're being developed.

Resources