Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i am using xlinx compiler, someone please help out , how to read text file from c:\ directory chunk by chunk .

What I have tried:

i tried in myself but its not working
Posted
Updated 21-Sep-17 22:45pm

 
Share this answer
 
Start with the sample code you may find here: fread - C++ Reference[^]. Modify it according to your needs (hint: given the file length lSize and the chunk length lChunkSize, you have to read (lSize/lChunkSize) full chunks, plus (lSize % lChunkSize) spare bytes).
Please note, on modern Windows OS versions, a standard user program is not allowed to write in C:\ folder.
 
Share this answer
 
It won't work if you are writing code for a Xilinx embedded system because c:\directory is a Windows (or DOS) path (probably on your development host).

To access files on such embedded systems you need storage hardware (e.g. HDD, SD card) and an OS running on the system that provides drivers for hardware and the used file system(s).

If you need to transfer file data from your development host to an embedded system you can use a communication interface (e.g. UART/serial or network) and implement code to handle the transfer and process the received data.

I can't give further help because you did not gave us any information about your project (hardware and used system software). For such very specific requests it might be also better to ask in a dedicated forum like Xilinx: Home - Community Forums[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900