Even this could do the trick:-
I'm not saying it's pretty; it is just another alternative if that suits your coding style. It uses very few processes, which might be important to performance if you have lots of files.
Assuming that this is to be used by something else that will expand it all again, is there a reason not to build this process into that code and remove the need to juggle it all and then re-expand?
Can you elaborate?
Robin
Last edited by rbatte1; 11-15-2017 at 09:18 AM..
Reason: Smartened code
hi guys
i give "ps -ef | grep some_executable_file" on the command line.
this "some_executable_file" resides on many paths which r included in the PATH environment variable, so the output depicts only "some_executable_file" in the COMMAND column. how can i get the full path?
thanx (3 Replies)
How can i list every single file on a sun solaris server running 2.8 starting from '/' with the full path included in it?
example.
/
...
...
...
/etc/inetd.conf
/etc/passwd
/etc/shadow
...
...
...
/var/adm/messages
/var/adm/messages.0
/var/adm/messages.1
...
...
...... (4 Replies)
Hi,
I have written this shell script:
fl=`ls -1lrt $mylist | grep '\.xml$' | awk '{print $9}'`
echo $fl (1)
for i in $fl
do
for dir in $mylist
do
if
then
echo $dir/$i >> tmp (2)
fi
done
done
The mylist contains some directory names. The satement (1) gives the sorted list... (5 Replies)
This has been bugging me for a while. How can i list file to show full path.
/directory/test
$ ls file.tst
file.tst
$
desired output:
/directory/test/file.tst (2 Replies)
I'm trying to clean up my samba share and need to print the found file or print the path of the image it tried to searched for. So far I have this but can't seem to get the logic right. Can anyone help point me in the right direction?
for FILE in `cat list`; do
if ;
then
... (1 Reply)
Hi,
I have a file abcd.txt which has contents in the form of full path file names i.e.
$home> vi abcd.txt
/a/b/c/r1.txt
/q/w/e/r2.txt
/z/x/c/r3.txt
Now I want to retrieve only the directory path name for each row
i.e
/a/b/c/
/q/w/e/
How to get the same through shell script?... (7 Replies)
Iam trying to load the full path of multiplie files in the same directory to an array if the filenames matches a pattern. The following is the current code;
where $input=C:\test
# change to and open the comparison directory
chdir("$input2") || die "Cannot change dir: $!";
opendir(DIR2,... (2 Replies)
Hi,
I would like to know how to grep all the paths in a file having extension .BMP
For e.g.
File Name :
sample.txt
File Content :
xxxxxxxxxxxxxxxxx
xxxxx/root/cdrive/picure.BMP xxxx
xxxxxxxxxxx
xxxxx/root/ddrive/picure.BMP xxxx
xxxxxxxxxxx
Expected Output : ... (4 Replies)
The bash will trim the folder to trim folder. Within each of the folders (there may be more than 1) and the format is always the same, are several .bam and matching .bam.bai files (file structure) and the bashunder that executes and trims the .bam as expected but repeats the.bam.bai extentions... (9 Replies)
Discussion started by: cmccabe
9 Replies
LEARN ABOUT PHP
ftp_nlist
FTP_NLIST(3) 1 FTP_NLIST(3)ftp_nlist - Returns a list of files in the given directorySYNOPSIS
array ftp_nlist (resource $ftp_stream, string $directory)
DESCRIPTION PARAMETERS
o $ftp_stream
- The link identifier of the FTP connection.
o $directory
- The directory to be listed. This parameter can also include arguments, eg. ftp_nlist($conn_id, "-la /your/dir"); Note that this
parameter isn't escaped so there may be some issues with filenames containing spaces and other characters.
RETURN VALUES
Returns an array of filenames from the specified directory on success or FALSE on error.
EXAMPLES
Example #1
ftp_nlist(3) example
<?php
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// get contents of the current directory
$contents = ftp_nlist($conn_id, ".");
// output $contents
var_dump($contents);
?>
The above example will output something similar to:
array(3) {
[0]=>
string(11) "public_html"
[1]=>
string(10) "public_ftp"
[2]=>
string(3) "www"
SEE ALSO ftp_rawlist(3).
PHP Documentation Group FTP_NLIST(3)