What file extension should be applied to NSCoder binary file format? - objective-c

When using NSCoder and NSKeyedArchiver, I understand the data is stored in binary format. Therefore, what is the most appropriate file extension for a storage file? Many tutorials use .plist, but I believe this should be text property lists ~ key / value pairs.

You would typically use a custom extension.

Related

How to read/edit Parasoft SOATEST .tst file by code or manually?

I need to read the .txt file as raw text or by code to extract the data keyed in the test suite (resource/assertors,....). Is there any way to do that? by code or any editor.
If you have binary format of tst file then there could be a problem, there is no official API to read it.
It's very old format, I don't think that is still in use.
There could be also two, newest, formats of tst:
compressed XML
XML
In case of compressed XML you have to unzip it and then you have access to XML, where you can read it as text file.
In case of XML, it's just XML, you can read it as pure text file.
There is no official API which allows to read it in similar way as SOAtest's GUI to use in code i.e.: in Java.

How do I create a custom file format on mac?

I want to create a file type that contains objective c code and image data. But I want it not readable by a text editor. How best do I do this?
Assuming you already know how to append the code and the image in a file (which, however, should be a pretty easy task), you just need to crypt the data before storing. You can easily do it using, i.e., AES encryption.

Read file to variable in Visual Basic

I want to be able to put a file to a variable so I can interact with it. For example I could put a wav file into a variable and play it back without having to distribute the separate file. Is this possible for instance by using Base64. I have seen some Python programs for example that have images embedded in the code.
Yes, you could conceivably store the contents of a binary .wav file as a static, uuencoded text array.
Probably a better way to go about it would be to create a "resource" for your binary data:
http://msdn.microsoft.com/en-us/library/xbx3z216.aspx

What is the best way of reading/writing binary input/output files with MapReduce?

In all samples I've seen so far, mapreduce apps take text files as input and write text as output.
I'd like my app to read objects from the binary file and write objects back to output file.
What is the best way to do that in MapReduce?
I'm writing the app in java
SequenceFile provides a persistent data structure for binary key-value pairs. You can find more information in the below URL.
http://wiki.apache.org/hadoop/SequenceFile
http://hadoop.apache.org/common/docs/current/api/org/apache/hadoop/io/SequenceFile.html

opening and writing to files in visual basic 2010

Am writing a simple application which can write a to pdf,doc,xls and access files. so far it can write to word.i also want it to be able to navigate a hard disk and open these files using filters.
i was using this code to write to the files
My.Computer.FileSystem.WriteAllText(SaveFileDialog1.FileName, TextBox1.Text, False)
how can i write to pdf and access files and also navigate and open files using openFileDialog?
You should be using System.IO for writting to files. Read the documentation on StreamWriter. It is very straight forward. One of the constructors for streamwriter accepts a string representation of the path to the file, and overloads allow you to specify a FileMode enumeration value. Normally you will use FileMode.OpenOrCreate when writting to the file.
OpenFileDialog is also straightforward. Create an instance and access the selected file property to get a string representation of the path. Use the static File.Exists("path") to check that a valid path was returned, then use the give path to open the file with a StreamReader.
There is more than one way to skin a cat here because static oriented FileInfo and DirectoryInfo are provided in System.IO, and there are the corresponding File and Directory classes which must be instantiated.
The use of these classes is very straightforward so I'm not going to sit here and type you example code but that should get you started.
As far as creating PDF and XLS files, I am assuming that you already have raw bytes that are in the correct format for those file types? If not, I can't help you there off hand. There are no Formatters in the .NET Framework that will convert ASCII or Unicode strings to a format that is acceptable for PDF or XLS that I am aware of. You are going to either need to dig into the specifics of those file formats or find a third party utility that will format your raw bytes or text into something those specifications.
If you are recieving the PDF and XLS data in the raw already properly formatted just use BinaryWriter to create the new file and write the raw array of bytes.