ubuntu-users Digest, Vol 78, Issue 65
maillistindia
maillistindia at gmail.com
Thu Feb 10 12:11:38 UTC 2011
Ideas for a RSS Reader.
I had sent across some mock ups and ideas for a RSS Reader. Is anyone
interested really?
On Thursday 10 February 2011 05:30 PM,
ubuntu-users-request at lists.ubuntu.com wrote:
> Send ubuntu-users mailing list submissions to
> ubuntu-users at lists.ubuntu.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
> or, via email, send a message with subject or body 'help' to
> ubuntu-users-request at lists.ubuntu.com
>
> You can reach the person managing the list at
> ubuntu-users-owner at lists.ubuntu.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ubuntu-users digest..."
>
>
> Today's Topics:
>
> 1. Re: C/C++ - Locating a user's home directory - SOLVED
> (Dotan Cohen)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 10 Feb 2011 11:23:41 +0200
> From: Dotan Cohen<dotancohen at gmail.com>
> To: dave at thefletchers.net, "Ubuntu user technical support, not for
> general discussions"<ubuntu-users at lists.ubuntu.com>
> Subject: Re: C/C++ - Locating a user's home directory - SOLVED
> Message-ID:
> <AANLkTimqyPAHMPUmHob8MtPZiT2n7wNSkQD2Zg55KXqj at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> On Sun, Jan 30, 2011 at 15:39, David Fletcher<dave at thefletchers.net> wrote:
>> // ? ? ?For the benefit of anybody else who searches Google
>> // ? ? ?to try to find an answer to this question:-
>>
>> // ? ? ?Short example
>> // ? ? ?how to write a C/C++ program for Linux to determine
>> // ? ? ?find the home directory of the user who is running it
>>
>> // ? ? ?Use the command
>> // ? ? ?g++ -Wall HomeDirTest.cpp -o HomeDirTest
>> // ? ? ?to compile this source
>>
>> // ? ? ?Compiled and tested by running as a cron job on an
>> // ? ? ?Ubuntu 10.04 server with the executable file copied
>> // ? ? ?to /usr/local/bin/
>>
>>
>> #include ? ? ? ?<stdio.h>
>> #include ? ? ? ?<string.h>
>> #include ? ? ? ?<pwd.h>
>> #include ? ? ? ?<fstream>
>>
>> using namespace std;
>>
>> int main(void)
>> {
>> ? ? ? ?ofstream DirTest;
>> ? ? ? ?int myuid;
>> ? ? ? ?struct passwd *mypasswd;
>> ? ? ? ?char TestFileName[30];
>>
>> ? ? ? ?myuid = getuid();
>> ? ? ? ?mypasswd = getpwuid(myuid);
>>
>> ? ? ? ?strcpy(TestFileName, mypasswd->pw_dir);
>> ? ? ? ?strcat(TestFileName, "/DirTestOutput");
>>
>> ? ? ? ?DirTest.open(TestFileName);
>> ? ? ? ?DirTest<< "This is a test\n\n";
>> ? ? ? ?DirTest<< "My uid is "<< myuid<< "\n\n";
>> ? ? ? ?DirTest.close();
>> }
>>
>>
> Hi Dave! I am just starting to learn C++ (I know a touch of C and some
> Java and PHP), and this snippet is a great example of useful
> real-world code. Do you have any more snippets that you would like to
> share? My goal is to ramp up my C++ for Google Summer of Code this
> year.
>
> Thanks!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20110210/2942a1d5/attachment.html>
More information about the ubuntu-users
mailing list