Connecting Tech Pros Worldwide Forums | Help | Site Map

Check directory/file protection?

Bill
Guest
 
Posts: n/a
#1: Oct 18 '05
Using ASP in a VBScript environment, how can I check the protection on a directory, or a
particular file?




Evertjan.
Guest
 
Posts: n/a
#2: Oct 18 '05

re: Check directory/file protection?


Bill wrote on 18 okt 2005 in microsoft.public.inetserver.asp.general:
[color=blue]
> Using ASP in a VBScript environment,[/color]

I suppose VBscript on an ASP platform?
[color=blue]
> how can I check the protection on
> a directory, or a particular file?[/color]

<%
file = "myDir/theFile.txt"
set fso = CreateObject("Scripting.FileSystemObject")
if fso.fileExists(server.MapPath("/" & file)) then
response.write "exists."
else
response.write "does not exist."
end if
set fso = nothing
%>

from: <http://www.aspfaq.com/show.asp?id=2351>

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Bill
Guest
 
Posts: n/a
#3: Oct 28 '05

re: Check directory/file protection?


Well, that tells me if it exists, but it doesn't return the directory/file protection,
does it?

Bill.


"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns96F3EE53984F2eejj99@194.109.133.242...[color=blue]
> Bill wrote on 18 okt 2005 in microsoft.public.inetserver.asp.general:
>[color=green]
> > Using ASP in a VBScript environment,[/color]
>
> I suppose VBscript on an ASP platform?
>[color=green]
> > how can I check the protection on
> > a directory, or a particular file?[/color]
>
> <%
> file = "myDir/theFile.txt"
> set fso = CreateObject("Scripting.FileSystemObject")
> if fso.fileExists(server.MapPath("/" & file)) then
> response.write "exists."
> else
> response.write "does not exist."
> end if
> set fso = nothing
> %>
>
> from: <http://www.aspfaq.com/show.asp?id=2351>
>
> --
> Evertjan.
> The Netherlands.
> (Replace all crosses with dots in my emailaddress)
>[/color]


Evertjan.
Guest
 
Posts: n/a
#4: Oct 28 '05

re: Check directory/file protection?


Bill wrote on 28 okt 2005 in microsoft.public.inetserver.asp.general:[color=blue]
> "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
> news:Xns96F3EE53984F2eejj99@194.109.133.242...[color=green]
>> Bill wrote on 18 okt 2005 in microsoft.public.inetserver.asp.general:
>>[color=darkred]
>> > Using ASP in a VBScript environment,[/color]
>>
>> I suppose VBscript on an ASP platform?
>>[color=darkred]
>> > how can I check the protection on
>> > a directory, or a particular file?[/color]
>>
>> <%
>> file = "myDir/theFile.txt"
>> set fso = CreateObject("Scripting.FileSystemObject")
>> if fso.fileExists(server.MapPath("/" & file)) then
>> response.write "exists."
>> else
>> response.write "does not exist."
>> end if
>> set fso = nothing
>> %>
>>
>> from: <http://www.aspfaq.com/show.asp?id=2351>[/color][/color]
[color=blue]
> Well, that tells me if it exists, but it doesn't return the
> directory/file protection, does it?[/color]

I don't think you can get that, exept by trial and error.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Closed Thread