RE: [PHP-WIN] Can I access files from a mapped drive or over the network?
| From: | HKG) | Date: | Tue, 08 Jan 2002 19:38:51 +0000 |
| Subject: | RE: [PHP-WIN] Can I access files from a mapped drive or over the network? | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-11349@lists.php.net to get a copy of this message | ||
In theory, yes. ;) But we all know to well that they really doesn't match
with each other. :(
By the way: did you get any error messages?
>-----Original Message-----
>From: Nicole Amashta [mailto:430ntr3k@bellsouth.net]
>Sent: Tuesday, January 08, 2002 8:21 PM
>To: php-windows@lists.php.net
>Subject: Re: [PHP-WIN] Can I access files from a mapped drive or over
>the network?
>
>
>The OS is Win2k. The files I want to access are flat text files
(.txt,.csv).
>This is NOT a DATABASE related question. This is strictly flat files.
>
>I have the shared directories mapped to the computer with a drive letter of
>R. So, in theory, according to what one said, I should be able to access
and
>list the directories and files on that shared directory. Well, I already
>tried this yesterday and it's not working. I used as the path:
>R:\\data as the path. I escaped the backslash appropriately. Still, no
>luck. However, when I want to list the contents of the C drive, or any
local
>partition, this works. SO, why can't I access the mapped drive ( R: ) ?
>
>* Originally I tried accessing the data by the network name, such as:
>\\ftpserver\data as $path = "\\\\ftpserver\\data"; This did not work
>either.
>
>Here is code that I am using to test this:
><snip>
><?
>include("../incs/FileSystem.inc"); // a wrapper class
>for the php
>file and dir functions
>
>$path = "R:\\Data\\JAU\\Sites"; // this is the mapped
>(shared) drive
>that resides on another computer.
>
>$fs = new FileSystem(); // this is an object I wrote that
>wraps all the file
>and directory functions
>
>if ( $list = $fs->getList($path) ) // getList() returns an
>array of the
>files and dirs found in $path (uses opendir )
>{
> $size = count($list);
> if ( $size > 0 )
> {
> for($i=0;$i<$size;$i++)
> {
> $fname = $list[$i];
> echo "$fname <br>"; // just print out; this is just testing
> }
> }
> else
> {
> echo "no files";
> }
>}
>else
>{
> echo "error listing files in: $path";
>}
>?>
></snip>
>
>Any ideas would be greatly appreciated!
>
>Thanks!
>Nicole Amashta
>www.aeontrek.com
>
>"B.A.T. Svensson" <B.A.T.Svensson@lumc.nl> wrote in message
>news:27E647E5629ED211BF78009027289C6303C1B5E7@mail1...
>> > I need to access data files residing on a
>different computer
>> in
>> >the same network as the computer running the php scripts. Is this
>possible?
>> >I can't find any documentation on this and I need to figure this out
>ASAP,
>> >as in today.
>> >
>> >Once I access the files, I need to be able to read from them Is this
>> >possible, and how??
>> >
>> >Please help. Thank you!! ;)
>>
>> And the type of files you want to share is? And these files
>recedes on
>what?
>> File system, DB, or? And the platform you working on is? Anyhow:
>>
>> If assume we are talking about regular flat files and you
>are using NT.
>Then
>> why not try to make a share? Then you can access the files
>just as any
>> normal file receding in the file system.
>>
>> Syntax for net share:
>>
>> [d:\vc98\include]net help share
>> The syntax of this command is:
>>
>>
>> NET SHARE sharename
>> sharename=drive:path [/USERS:number | /UNLIMITED]
>> [/REMARK:"text"]
>> sharename [/USERS:number | /UNLIMITED]
>> [/REMARK:"text"]
>> {sharename | devicename | drive:path} /DELETE
>>
>> NET SHARE makes a server's resources available to network users. When
>> used without options, it lists information about all resources being
>> shared on the computer. For each resource, Windows NT reports the
>> devicename(s) or pathname(s) and a descriptive comment
>associated with it.
>>
>> sharename Is the network name of the shared resource. Type
>> NET SHARE with a sharename only to
>display information
>> about that share.
>> drive:path Specifies the absolute path of the directory to
>> be shared.
>> /USERS:number Sets the maximum number of users who can
>> simultaneously access the shared resource.
>> /UNLIMITED Specifies an unlimited number of users can
>> simultaneously access the shared resource
>> /REMARK:"text" Adds a descriptive comment about the resource.
>> Enclose the text in quotation marks.
>> devicename Is one or more printers (LPT1: through LPT9:)
>> shared by sharename.
>> /DELETE Stops sharing the resource.
>>
>> NET HELP command | MORE displays Help one screen at a time.
>>
>> [d:\vc98\include]
>
>
>
>--
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
>For additional commands, e-mail: php-windows-help@lists.php.net
>To contact the list administrators, e-mail:
>php-list-admin@lists.php.net
>