ba17
![]() |
|
|
|
|
|||||||
| Userland Programming & Scripting C, Shell, Perl, Sed & Awk |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hello,
how to open file like "/home/toto/file.alx" with "$HOME/file.alx" or "~/file.alx" in C language ? Attention i don't want to part arguments into main ! Thanks |
|
#2
|
||||
|
||||
|
Not all shells understand ~ is $HOME.
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
|
#3
|
||||
|
||||
|
you need to read environment variables HOME
Code:
extern char **environ; It will be like HOME=/home/user\0 (C string) INFO from Advanced Programming in the Unix Environment 2nd edition |
|
#5
|
|||
|
|||
|
Solved, thanks.
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Folding@home | anemos | Off-Topic | 7 | October 8th, 2011 13:57 |
| How do you organize your home directory? | Agi93 | General | 36 | March 24th, 2010 00:16 |
| New User Home Directory | epanagio | General | 4 | October 2nd, 2009 07:33 |
| Samba & XP Home client | squatter | Web & Network Services | 2 | August 10th, 2009 08:30 |
| home server jail | SuperMiguel | General | 22 | June 19th, 2009 00:32 |