📄 fserver.c
字号:
Closes an open file.
Parameters:
In: inPB - Ptr to a Server Parameter block
->fHandle - Handle to the file
Out: inPB - Info returned in the parameter block
->fResult - Error code
------------------------------------------------------------ */
UInt16 ServerClose( ServerPB * inPB )
MakeFunction ( kServerClose )
/* ------------------------------------------------------------
ServerGetSpace [Macintosh]
Retruns the free space on a volume.
Parameters:
In: inPB - Ptr to a Server Parameter block
->fVRefNum - The volume ref num
Out: inPB - Info returned in the parameter block
->fResult - Error code
->fSize - Free space on the drive / 32k
->fPosition - Total space on drive / 32k
------------------------------------------------------------ */
UInt16 ServerGetSpace( ServerPB * inPB )
MakeFunction ( kServerGetSpace )
/* ------------------------------------------------------------
ServerMkDir [Macintosh]
Creates a new directory on the server.
NOTE: For long file name support, set fDosName[0] = 0 and
the long file name in fName
Parameters:
In: inPB - Ptr to a Server Parameter block
->fFlags - 0 = DOS Names, 1 = LFN
->fVRefNum - The volume ref num
->fParentID - Directory ID
->u.fXXX.fName - the file name
Out: inPB - Info returned in the parameter block
->fResult - Error code
------------------------------------------------------------ */
UInt16 ServerMkDir( ServerPB * inPB )
MakeFunction ( kServerMkDir )
/* ------------------------------------------------------------
ServerRmDir [Macintosh]
Removes (deletes) an existing directory.
Parameters:
In: inPB - Ptr to a Server Parameter block
->fFlags - 0 = DOS Names, 1 = LFN
->fVRefNum - The volume ref num
->fParentID - Directory ID
->fName - the name of the dir to remove (Mac format)
Out: inPB - Info returned in the parameter block
->fResult - Error code
------------------------------------------------------------ */
UInt16 ServerRmDir( ServerPB * inPB )
MakeFunction ( kServerRmDir )
/* ------------------------------------------------------------
ServerSetAttributes [internal]
Sets the attributes (read-only, system, hidden, etc.) for the
specified file.
Parameters:
In: inPB - Ptr to a Server Parameter block
->fFlags - 0 = DOS Names, 1 = LFN
->fVRefNum - The volume ref num
->fParentID - The parent directory ID
->u.fXXX.fName - the directory name
->fFileAttributes - New attributes
->fFileTimeDate - New Time & Date or NULL if no change in time and date
Out: inPB - Info returned in the parameter block
->fResult - Error code
------------------------------------------------------------ */
UInt16 ServerSetAttributes( ServerPB * inPB )
MakeFunction ( kServerSetAttributes )
/* ------------------------------------------------------------
ServerRename [Macintosh]
Renames a specified file to a name built from the original
filename and the rename template.
Parameters:
In: inPB - Ptr to a Server Parameter block
->fFlags - 0 = DOS Names, 1 = LFN
->fVRefNum - The volume ref num
->fParentID - Source Directory ID
->fID - Destination Directory ID
->u.fXXX.fName - the name
->u.fXXX.fName2 - the new name
Out: inPB - Info returned in the parameter block
->fResult - Error code
------------------------------------------------------------ */
UInt16 ServerRename( ServerPB * inPB )
MakeFunction ( kServerRename )
/* ------------------------------------------------------------
ServerDelete [Macintosh]
Deletes the specified file.
Parameters:
In: inPB - Ptr to a Server Parameter block
->fFlags - 0 = DOS Names, 1 = LFN
->fVRefNum - The volume ref num
->fParentID - The parent directory ID
->u.fXXX.fName - the name
Out: inPB - Info returned in the parameter block
->fResult - Error code
------------------------------------------------------------ */
UInt16 ServerDelete( ServerPB * inPB )
MakeFunction ( kServerDelete )
/* ------------------------------------------------------------
ServerGetInfo [Macintosh]
Returns information about the specified directory or file.
Parameters:
In: inPB - Ptr to a Server Parameter block
->fFlags - 0 = DOS Names, 1 = LFN
->fVRefNum - The volume ref num
->fParentID - ParentDirectory ID
->fIndex - Which entry in this DIR to get info on (0-n)
->u.fXXX.fName - the file name (ignored is fIndex != -1)
Out: inPB - Info returned in the parameter block
->fResult - Error code
->u.fXXX.fName - the file name
->fFileTimeDate - File's time & date
->fSize - File's size
->fFileAttributes - Directory or file's attributes
->fID - Dir ID of the directory or File
------------------------------------------------------------ */
UInt16 ServerGetInfo( ServerPB * inPB )
MakeFunction ( kServerGetInfo )
/* ------------------------------------------------------------
ServerLock [Macintosh]
Locks a range of an open file.
Parameters:
In: inPB - Ptr to a Server Parameter block
->fHandle - Handle to the file
->fPosition - The start of the lock range
->fSize - The length of the lock range
->fOpenMode - 0 = Lock , !0 = Unlock
Out: inPB - Info returned in the parameter block
->fResult - Error code
------------------------------------------------------------ */
UInt16 ServerLock( ServerPB * inPB )
MakeFunction ( kServerLock )
/* ------------------------------------------------------------
ServerGetFCBInfo [Macintosh]
Returns information about an open file.
Parameters:
In: inPB - Ptr to a Server Parameter block
->fFlags - 0 = DOS Names, 1 = LFN
->fHandle - Handle to the file
Out: inPB - Info returned in the parameter block
->fResult - Error code
->fVRefNum - Macintosh volume ref num
->fParentID - Macintosh parent folder ID
->u.fXXX.fName - the file name
->fID - Macintosh file ID
->fPosition - The current file position
->fSize - The length of the file
->fOpenMode - The open mode
->fFileAttributes-0 - R/W, 1 = Read Only
------------------------------------------------------------ */
UInt16 ServerGetFCBInfo( ServerPB * inPB )
MakeFunction ( kServerGetFCBInfo )
/* ------------------------------------------------------------
ServerGetMaxIOSize [Macintosh]
Get the maximum I/O size if supported, 0 if not.
Parameters:
In: none
Out: none
------------------------------------------------------------ */
void ServerGetMaxIOSize()
{
unsigned __int32 Result;
WaitForSingleObject(g_FolderShareMutex, INFINITE);
v_FolderShareDevice->ServerPB = (unsigned __int32)gpServerPB;
v_FolderShareDevice->Code = kServerGetMaxIOSize; // this executes the function
Result = v_FolderShareDevice->Result;
ReleaseMutex(g_FolderShareMutex);
kMaxReadWriteSize = Result;
} // ServerGetMaxIOSize
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -