|
|
2010-03-01
, 19:14
|
|
Posts: 270 |
Thanked: 239 times |
Joined on Dec 2009
@ Czech Republic
|
#11
|
|
|
2010-03-01
, 19:29
|
|
|
Posts: 253 |
Thanked: 184 times |
Joined on Nov 2009
@ Bristol, UK
|
#12
|
ls -l -R /home/user/.app
ls -l -d /home/user/.app
#include <stdio.h>
int main()
{
FILE *file = fopen("/home/user/.app/save.txt","w");
if (!file) {
perror("open failed");
return 1;
}
}
| The Following User Says Thank You to spanner For This Useful Post: | ||
|
|
2010-03-01
, 19:46
|
|
Posts: 270 |
Thanked: 239 times |
Joined on Dec 2009
@ Czech Republic
|
#13
|
void save() {
FILE *file = fopen("/home/user/.app/save.txt","w");
for (int x = 0; x < 9; x++) {
for (int y = 0; y < 9; y++) {
fprintf(file,"%c",unsolved[x][y]);
}
}
for (int x = 0; x < 9; x++) {
for (int y = 0; y < 9; y++) {
fprintf(file,"%c",base[x][y]);
}
}
fclose(file);
FILE *file2 = fopen("/home/user/.app/candidates.txt","w");
//save candidates
char buffer[11];
string str;
for (int x = 0; x < 9; x++) {
for (int y = 0; y < 9; y++) {
str = candidates[x][y]+';';
strcpy(buffer,str.c_str());
fprintf(file2,"%s",buffer);
}
}
fclose(file2);
}
|
|
2010-03-01
, 19:55
|
|
|
Posts: 253 |
Thanked: 184 times |
Joined on Nov 2009
@ Bristol, UK
|
#14
|
|
|
2010-03-01
, 20:01
|
|
Posts: 270 |
Thanked: 239 times |
Joined on Dec 2009
@ Czech Republic
|
#15
|
|
|
2010-03-01
, 20:17
|
|
|
Posts: 253 |
Thanked: 184 times |
Joined on Nov 2009
@ Bristol, UK
|
#16
|
chown -R user.users /home/user/.app
| The Following User Says Thank You to spanner For This Useful Post: | ||
|
|
2010-03-01
, 20:32
|
|
Posts: 270 |
Thanked: 239 times |
Joined on Dec 2009
@ Czech Republic
|
#17
|
|
|
2010-03-01
, 20:57
|
|
|
Posts: 253 |
Thanked: 184 times |
Joined on Nov 2009
@ Bristol, UK
|
#18
|
Thank you very much. Now it works. I have a last question. How run this command after install app?
mkdir("/home/user/.app", 0777);
|
|
2010-03-01
, 21:09
|
|
Posts: 270 |
Thanked: 239 times |
Joined on Dec 2009
@ Czech Republic
|
#19
|
|
|
2010-03-01
, 21:20
|
|
Posts: 5,335 |
Thanked: 8,187 times |
Joined on Mar 2007
@ Pennsylvania, USA
|
#20
|
Thanks but before first run this program is this dir created. Dir creates in installation of app.