-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathExtraFunctions.asp
More file actions
77 lines (65 loc) · 1.95 KB
/
ExtraFunctions.asp
File metadata and controls
77 lines (65 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<% ' Deprecated functionalities that may be useful for users
' Checks if File does exist in System.
' Deprecated due to unnecessary increase of call stack.
'
' @param {string} File
' @param {FileSystemObject} System
' @return {bool}
Function FileDoExist( ByRef File, ByRef System )
FileDoExist = System.FileExists(Server.MapPath(File))
End Function
' Checks if File exist.
' Deprecated because it was not used.
'
' @param {string} File
' @return {bool}
Function FileExists(ByRef File)
Dim System : Set System = Server.CreateObject("Scripting.FileSystemObject")
FileExists = System.FileExists(Server.MapPath(File))
Set System = Nothing
End Function
' Gets the name of the file.
' Deprecated due to unnecessary increase of call stack.
'
' @param {string} File
' @return {string}
Function FileName(ByRef File)
Dim BarIndex
File = Replace(File, DynamicInclude_ReverseBar, DynamicInclude_Bar)
BarIndex = InStrRev(File, DynamicInclude_Bar)
FileName = Mid(File, BarIndex + 1, LEN(File) - BarIndex)
End Function
' Gets the path of a file.
' Deprecated due to unnecessary increase of call stack.
'
' @param {string} File
' @return {string}
Function FilePath(File)
Dim BarIndex
File = Replace(File, DynamicInclude_ReverseBar, DynamicInclude_Bar)
BarIndex = InStrRev(File, DynamicInclude_Bar)
if IsNull(BarIndex) or BarIndex = 0 then
FilePath = vbNullString
else
FilePath = Mid(File, 1, BarIndex)
end if
End Function
' Syntax sugar.
' Deprecated because it was completely unnecessary.
'
' @return {FileSystemObject}
Function FileSystem( )
Set FileSystem = Server.CreateObject("Scripting.FileSystemObject")
End Function
' Gets the absolute equivalent of Path.
' Deprecated due to unnecessary increase of call stack.
'
' @param {string} Path
' @return {string}
Function MapPath( Path )
if Path = vbNullString then
Path = DynamicInclude_CurrentFolder
end if
MapPath = Server.MapPath(Path)
End Function
%>