April 2, 2012

victoryfox victoryfox
Lab Rat
8 posts

Load multiple files from directory in memory

 

Using QFileDialog how can i

a) open multiple files from a given directory on the local hard disk?

scenario:

- open dir – in that dir search for the following files: Tables.sql , Indexes.sql , Views.sql,…etc. Anyway, these are hardcoded. – if they not found -> error msg, else: – load every file in memory.

b) save every file to memory for later processing. I thought of QByteArray?

INFO:

While i parse for example: Tables.sql, i will need for some tables also their indexes,..etc. SO i thought the best way would be to load files to ByteArrays.

Thanks in advanced
fox

1 reply

April 2, 2012

TheDestroyer TheDestroyer
Lab Rat
150 posts

Just use a QFile or fstream, and loop over all the files in the directory, and open them 1 by 1…! then do everything you wanna do with them!

 
  ‹‹ I can run command script via terminal but gui application does not....      [SOLVED] QVariant’s .toDouble() returns 0.0 incorrectly ››

You must log in to post a reply. Not a member yet? Register here!