This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I'd like to use "loadRaw" in a DSS script to load a .bin in memory.
The documentation tell :
public void loadRaw(int nPage, long nAddress, java.lang.String sFilename, int nTypeSize, boolean bByteSwap)
throws ScriptingException
nAddress
- is the first address in the block.nPage
- the memory page. Use one of Memory.Page enumeration.sFilename
- specifies the name of the file that will store the target data.nTypeSize
- specifies the type size of the data. Affects how data is
byte-swapped to account for differences
in host and target endianess. For example: if
the target is big endian (the host is always little endian) and
you specify nTypeSize = 16 then the upper and
lower bytes are swapped after loading the file - but before
writing to target memory.bByteSwap
- Force a byte-swap of the data before writing to target memory. If Host and Target are difference endianess - this will
effectively disable the automatic endianess conversion.
ScriptingException
According to the documentation this function has no return value, but a see that "Filesize is automatically determined and the entire file is loaded".
So, is there a way to obtain the filesize as return value? or is there any other method in a DSS script to retrieve the size of the .bin file I want to load in memory?
Thanks,
Luca.
Hello Luca,
You can just use standard Java file APIs to return the length of the file.
http://download.oracle.com/javase/6/docs/api/java/io/File.html#length%28%29
Thanks
ki