reading classical ini file on iPhone - iphone

does anybody knows how to parse an ini file ? I guess I need a regular expression or something.
I have only this pattern in the file :
varName=value;
Thanks a lot !
update : here you go : https://github.com/DrMoriarty/MetroEditor/tree/master/MetroEditor/ini

There's an INI file parser written in objective C available here - either use it directly, or read the source to pick up a few tips.
EDIT: as that link appears dead, try this alternative - thanks mc007

Related

Prof configuration (INCA tools)

I use the INCA tools for the first time. I would like to cset a prof config to flash binary file to my ECU. I tried to create the needed files. I have some question please.
1/ to convert the hex file into binary file i copied this from tuto
procedure convert
{
[convert_bin]
RUN_DLL ("CONVERT.DLL",convert,-h,-i,-q,-b,%1)
case TRUE : $return TRUE
default : $return FALSE
[convert_bin_END]
}
I would like to know what is the CONVERT.dll file, will it get generated automatically or should I create this file ?
2/ Can I flash directly a binary file to my ECU ?
3/ who can correct my script I have several problems on ?
thanks a lot :)
1/ to convert the hex file into binary file i copied this from tuto
I would like to know what is the CONVERT.dll file, will it get generated >automatically or should I create this file ?
CONVERT.dll is preset dll from INCA, no need to create this file, it's already available
2/ Can I flash directly a binary file to my ECU ?
yes, you can flash directly a binary file to your ECU
3/ who can correct my script I have several problems on ? thanks a lot :)
it need a lot of input and information from your hex file also

Is there a builtin library for moving and replacing a file?

As the title suggests, is there a builtin library for moving a file and replacing an existing file if it exists?
I tried os.rename(path1, path2), but that doesn't seem to handle overwriting existing files.
Working with a pycom gpy, if that matters.
Thanks in advance
POSIX semantics require overwriting the target file in this case (and even atomically). So, "pycom gpy" seems to have a bug (or misfeature) in that regard. As a workaround, you can remove the target file with os.remove(path2) before rename.

Best way to compare projects on Enterprise Architect

I want to know if there is a way to see the changes I made it to a linked files when I compare a project against a base line or a file to file.
I tried the compare utility from base line and file to file comparassion, and its works, if I add a linked file to x component or edit an existing one, it shows that there is change, but not in the best o most readeable way.
There is another way or tool to acomplished that?
Thank you.
pd_ sorry for my bad english
You can
Write your own comparison engine
Export the comparison xml and use that to present it in a way you like it better
Use LieberLiebers Lemontree

Can I edit a TLV file using a perl script?

I'm trying to find out if it's possible to edit/add parameters to a TLV* file because I have no idea if a solution exists and how to go about it. Thank you.
A tlv file (extension .bin file) is an emta configuration file defined by docsis.
You can of course create your own DOCSIS-file parser/manipulater in Perl (or whatever language). My advise is not to re-invent the wheel and use http://docsis.sourceforge.net/ as a basis for your needs.
Another approach could be to use http://www.excentis.com/product.php?product_id=7 (Free, but closed source AFAIK)

smlnj rephrased question for listdir(filename, directoryname)

i am a newbie learning sml and the question i am thrown with involves IO functions that i have no idea how it works even after reading it. Here is the 2 questions that i really need help with to get me started, please provide me with codings and some explaination, i will be able to trial and error with the code given for the other questions.
Q1) listdir(filename,directoryname), which given the name of a directory, list its contents in a text file. The listing is in a form that makes it easy to seperate filenames, dates and sizes from each other. (similar to what msdos does with "dir" but instead of just listing it out, it places all the files and details into a text file.
Q2) readlist(filename) which reads a list of filenames (each of which were produced by listdir in (Q1) and combines them into one large list. (reads from the text file in Q1 and then assigning the contents into 1 big list containing all the information)
Thing is, i only learned from the lecturer in school on the introduction section, there isnt even a system input or output example shown, not even the "use file" function is taught. if anyone that knows sml sees this, please help. Thanks to anyone who took the effort helping me.
Thanks for the reply, current I am using SMLNJ to try and do this. Basically, Q1 requires me to list the directory's files of the "directoryname" provided into a text file in "filename". The Q2 requires me to read from the "filename" text file and then place the contents into one large list.
Duplicate of: smlnj listdir
As a hint I will say that you have to make use of these functions:
OS.FileSys.OpenDir(directoryname) - this will open directory stream for you (Q1)
TextIO.openOut(filename) - this will open the file stream (Q2)
TextIO.openIn(filename)- this will open the file (Q2)
If you are stuck and dont' know how to do the progs then I will post the full code here, but i suggest you first give a try.
zubair sheikh