123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home

Source Codes

Engineering Colleges

BE Students

Training  Reports (updated)

Seminar Reports (updated

Placement Papers (updated)

Forums

   Computer Science / IT

   Electronics

   Electrical

   Mechanical

   Chemical

   Civil

   CAT / MBA

   GMAT / Foreign MBA

Latest Jobs

Engineering Jobs / Technical Jobs

Management Jobs

Sitemap

About-Us

Terms of use

Displaying  Source Code(s)  
 

 
--------------------------------------------------------------------------------

MkFile Statement

--------------------------------------------------------------------------------

Description : The MkFile statement creates a file on the server. The MkFile statement has one required argument, pathname. Pathname must be the complete path and file name with extension to be created.

example usage:
<%
' Make an asp file named File in the directory New Folder

MkFile Server.MapPath("/New Folder/File.asp")
%>

source code:
<%
Private Sub MkFile(ByVal pathname)
Dim objFSO, boolErr, strErrDesc
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(pathname) Then
Err.Raise 5106, "MkFile Statement", "File [" & pathname & "] " & _
"Already Exists. Use the Kill statement to delete files."
Else
On Error Resume Next
objFSO.CreateTextFile pathname, 2, True
If Err Then
boolErr = True
strErrDesc = Err.description
End If
On Error GoTo 0
If boolErr Then Err.Raise 5106, "MkFile Statement", strErrDesc
End If
Set objFSO = Nothing
End Sub
%>

--------------------------------------------------------------------------------
 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved copyright 123ENG