How to get root folder of SD card? - General Discussion and Assistance - CHDK Forum

How to get root folder of SD card?

  • 2 Replies
  • 2897 Views
How to get root folder of SD card?
« on: 03 / September / 2015, 14:28:07 »
Advertisements
Hi,

reyalp told me (thanks):

Quote
You can read and write files using stdio functions like fopen etc. You can list directories using opendir/readdir (look at the file browser code for examples)

Before diving into the file browser code I have to questions:

1. How do I get the root folder of the SD card?

2. Is it possible to write some simple txt-file using CHDK into the root folder (or any other directory) of the SD card?

Thanks!
2 x IXUS 860IS 100c
2 x Powershot S110 103a

*

Offline reyalp

  • ******
  • 14110
Re: How to get root folder of SD card?
« Reply #1 on: 03 / September / 2015, 17:10:34 »
1. How do I get the root folder of the SD card?
The root of the filesystem is A/

Note the / is part of the name. For any other directory, you should not put a / at the end.

Quote
2. Is it possible to write some simple txt-file using CHDK into the root folder (or any other directory) of the SD card?
Yes. Just use, fopen, fwrite and fclose like you would on any other OS.
Don't forget what the H stands for.

Re: How to get root folder of SD card?
« Reply #2 on: 04 / September / 2015, 03:19:59 »
Hi reyalp,

thanks this helped me a lot!
2 x IXUS 860IS 100c
2 x Powershot S110 103a

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal