473,471 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Getting directory contests using DIR

Hi all

I was wondering to try something like this:

exec("dir \"".$sSearchPath."\\*.pdf\" >c:\hhh.txt");

though, it hangs at that point. I tried system(), shell_exec/() etc
similar result.

Have anyone tried this?

S

Nov 27 '06 #1
4 1234
Don't execute shell commands to do this. In PHP5 use
http://php.net/scandir, in PHP4 use http://php.net/readdir.

Sonnich wrote:
Hi all

I was wondering to try something like this:

exec("dir \"".$sSearchPath."\\*.pdf\" >c:\hhh.txt");

though, it hangs at that point. I tried system(), shell_exec/() etc
similar result.

Have anyone tried this?

S
Nov 27 '06 #2
The idea is to speed it up, when e.g. as now, reading that 126 times,
it becomes slow.
The idea is to create this file, and check the time for it. When it is
"new", I can use it for checking whether certain files are presnt, and
run the dir only once.
It is much faster to read in a txt file than running the opendir
request again.

Current I run it 126 with the present values - orders. They might
change, but since a large amount of those are similar, they might be in
the same places.

Anyway, I found that a small test programme with this works, while a my
current software does not like it, and stops at that point.

BR
Sonnich

Michael Cooney wrote:
Don't execute shell commands to do this. In PHP5 use
http://php.net/scandir, in PHP4 use http://php.net/readdir.

Sonnich wrote:
Hi all

I was wondering to try something like this:

exec("dir \"".$sSearchPath."\\*.pdf\" >c:\hhh.txt");

though, it hangs at that point. I tried system(), shell_exec/() etc
similar result.

Have anyone tried this?

S
Nov 27 '06 #3
What's stopping you from writing the results of readdir to a file from
within PHP?

Sonnich wrote:
The idea is to speed it up, when e.g. as now, reading that 126 times,
it becomes slow.
The idea is to create this file, and check the time for it. When it is
"new", I can use it for checking whether certain files are presnt, and
run the dir only once.
It is much faster to read in a txt file than running the opendir
request again.

Current I run it 126 with the present values - orders. They might
change, but since a large amount of those are similar, they might be in
the same places.

Anyway, I found that a small test programme with this works, while a my
current software does not like it, and stops at that point.

BR
Sonnich

Michael Cooney wrote:
Don't execute shell commands to do this. In PHP5 use
http://php.net/scandir, in PHP4 use http://php.net/readdir.

Sonnich wrote:
Hi all
>
I was wondering to try something like this:
>
exec("dir \"".$sSearchPath."\\*.pdf\" >c:\hhh.txt");
>
though, it hangs at that point. I tried system(), shell_exec/() etc
similar result.
>
Have anyone tried this?
>
S
Nov 28 '06 #4

Michael Cooney wrote:
What's stopping you from writing the results of readdir to a file from
within PHP?
It is slow.

I found a problem - while this works:
exec("dir c:\\*.* >".dirname(__FILE__)."\\hh.txt");

then this does not

exec("dir \\\\some_server\\dir1\\dir2\\*.*
>".dirname(__FILE__)."\\hh.txt");
it does not like the server path.... hmmm might wannt look at the
server....

S

>
Sonnich wrote:
The idea is to speed it up, when e.g. as now, reading that 126 times,
it becomes slow.
The idea is to create this file, and check the time for it. When it is
"new", I can use it for checking whether certain files are presnt, and
run the dir only once.
It is much faster to read in a txt file than running the opendir
request again.

Current I run it 126 with the present values - orders. They might
change, but since a large amount of those are similar, they might be in
the same places.

Anyway, I found that a small test programme with this works, while a my
current software does not like it, and stops at that point.

BR
Sonnich

Michael Cooney wrote:
Don't execute shell commands to do this. In PHP5 use
http://php.net/scandir, in PHP4 use http://php.net/readdir.
>
Sonnich wrote:
Hi all

I was wondering to try something like this:

exec("dir \"".$sSearchPath."\\*.pdf\" >c:\hhh.txt");

though, it hangs at that point. I tried system(), shell_exec/() etc
similar result.

Have anyone tried this?

S
Nov 29 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Opa | last post by:
Hi, Does anyone know how to get a list of files for a given directory from a given url. I have the following, but get an error indicating that URI formats are not supported. ...
6
by: john_williams_800 | last post by:
Hi; I am writing an html page that will live on one server in an ms windows network, but access pictures from a directory on another ms windows server in the network. I know in html the...
2
by: David Hearn | last post by:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Description: An unhandled exception occurred during the execution of the current...
19
by: sasan3 | last post by:
Every thread I start goes out on a tangent simply because some of you people are not reading my posts carefully: Here is the phrase I am proposing for inclusion in the FAQ: "to existing...
0
by: ruju00 | last post by:
I am getting an error in Login() method of the following class FtpConnection public class FtpConnection { public class FtpException : Exception { public FtpException(string message) :...
8
by: lawrence k | last post by:
I've installed Apache 1.3.36 on my Redhat EL 3 machine. Now I'm trying to install PHP 5.1.4. I can not get the ./configure command to work. I keep getting this error: configure: error: Invalid...
5
by: Michael Howes | last post by:
I'm writing a utility to manage a machines *local* accounts in c# I am getting all the users in a specific Group just fine but when I want to get some of the information on each user from their...
3
by: Nathan Sokalski | last post by:
I am getting the list of subdirectories from a specified directory using System.IO.Directory.GetDirectories(), and would like to get only subdirectories that are not hidden or system directories. I...
1
by: programmerboy | last post by:
It is been a long time since I have coded something really sleek. And now I am forgetting all the code. I am using VB to try to connect to a directory on another server so I can access its...
13
by: lawpoop | last post by:
Hello all - I have a two part question. First of all, I have a website under /home/user/www/. The index.php and all the other website pages are under /home/user/www/. For functions that are...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.