Advertisement
ASP_Volume2 Files #42442

Folder Management Functions (Create, Delete, Move etc...)

Functions to Create folder, Delete Folder, Move Folder, Copy Folder, Check if File Exists, and folder size in bytes

AI

Résumé par IA: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Code source
original-source
<%
'#######################################
'# Folder Management Functions
'# Written By Jason
'# '#####################################
'# Site San Diego
'# sitesd.com
'#######################################
	Dim objFso
	'# CREATE FOLDER
	Function CreateFolder(fdirCRE)
			Set objFso = CreateObject("Scripting.FileSystemObject")
			If Not objFso.FolderExists(fdirCRE) Then
				objFso.CreateFolder(fdirCRE)
					Else
				Exit Function
			End If
			set objFso = nothing
	End Function
	
	'# DELETE FOLDER
	Function DeleteFolder(fdirDEL)
		Set objFso = CreateObject("Scripting.FileSystemObject")
		If objFso.FolderExists(fdirDEL) Then
			 objFso.DeleteFolder(fdirDEL)
		End If
		set objFso = nothing
	End Function
	
	'# MOVE FOLDER
	Function MoveFolder(fdirM1, fdirM2)
		Set objFso = CreateObject("Scripting.FileSystemObject")
		objFso.MoveFolder fdirM1, fdirM2
		set objFso = nothing
	End Function
	
	'# COPY FOLDER
	Function CopyFolder(fdirC1, fdirC2, fdirC3)
		If fdirC3 = "" then fdirC3 = False
		Set objFso = CreateObject("Scripting.FileSystemObject")
		objFso.CopyFolder fdirC1, fdirC2, fdirC3
		set objFso = nothing
	End Function
	
	'# CHECK IF FILE EXSISTS
	Function FileHere(fdirHere)
			Set objFso = CreateObject("Scripting.FileSystemObject")
			If objFso.FileExists(fdirHere) Then
				FileHere = True
					Else
				FileHere = False
			End If
			set objFso = nothing
	End Function
	
	
	
		'# Folder Size
		Function FolderSize(filespec)
		  Set fso = CreateObject("Scripting.FileSystemObject")
			  Dim fso, f, s
			If fso.FolderExists(filespec) Then
				  Set f = fso.GetFolder(filespec)
				  s = f.size 
				  If s = "" then s = "0"
			  Else
				  s = "0"
			 End If
			  FolderSize = CLNG(s)
		  Set fso=nothing
		End Function
	
%>
Commentaires originaux (3)
Récupéré via Wayback Machine