Ask a Question related to PHP Development, Design and Development.
-
bjg #1
Reading a line at a time from a file
Hey,
Just wondering what the best way to do this is?
What i specifically want to do is check if a user exists on a unix machine.
The best way i was told was to read a line at a time of /etc/passwd and
check if the username is in that line.
Cheers
bjg Guest
-
Reading Last Line in a Txt File
Hi, I'm trying to read the last line in a file using "ASFileRead" function. Im having trouble specifying the last parameter which counts the... -
Reading a file from a URL at design-time
Im' building a custom menu control based on a XML file. I've added the following property: private string _xmlSourceUrl; public string... -
install HTML::Template - Problem reading cache file / Bad file number
i get the following error when i try to install HTML::Template to my local space, ie, not as root: +---------------------------- % perl -MCPAN... -
Reading tab delimited File & sort everything according item 5 of every line
let say that the file contains these items (every item is seperated with a tab) one title state name code1 number two title2 state2 ... -
Reading a scalar line by line
Hi, does anyone know how I would do this? something like: while ($string) print _$ } Google searches did not turn up anything. -
RG #2
Re: Reading a line at a time from a file
"bjg" <bjg_at_internode.on.net> wrote in message
news:3f70508d$1@duster.adelaide.on.net...machine.> Hey,
>
> Just wondering what the best way to do this is?
>
> What i specifically want to do is check if a user exists on a unix> The best way i was told was to read a line at a time of /etc/passwd and
> check if the username is in that line.
>
> Cheers
>
>
see file();
RG
RG Guest
-
David Gillen #3
Re: Reading a line at a time from a file
An noise sounding like bjg said:
system("grep <username> /etc/password") and process the result. Probably a> Hey,
>
> Just wondering what the best way to do this is?
>
> What i specifically want to do is check if a user exists on a unix machine.
> The best way i was told was to read a line at a time of /etc/passwd and
> check if the username is in that line.
>
whole hella lot quicker on system with a large number of users and reading in
and having php parse and search the whole file.
Dave
--
I'm a dead man, and buggered to boot!
David Gillen Guest



Reply With Quote

