public void SetFileName(string directory, string file) { this.AssertInternalLobIsValid(); if (!this.IsNull) { this._lob.AssertConnectionIsOpen(); this._lob.AssertTransactionExists(); OciFileDescriptor filep = (OciFileDescriptor) this.LobLocator.Descriptor; if (filep != null) { this.LobLocator.ForceClose(); int rc = TracedNativeMethods.OCILobFileSetName(this.Connection.EnvironmentHandle, this.ErrorHandle, filep, directory, file); if (rc != 0) { this.Connection.CheckError(this.ErrorHandle, rc); } this.LobLocator.ForceOpen(); this._fileName = null; this._directoryAlias = null; try { this._lob.Position = 0L; } catch (Exception exception) { if (!System.Data.Common.ADP.IsCatchableExceptionType(exception)) { throw; } } } } }
internal static int OCILobFileSetName(OciHandle envhp, OciHandle errhp, OciFileDescriptor filep, string dir_alias, string filename) { if (Bid.AdvancedOn) { Bid.Trace("<oc.OCILobFileSetName|ADV|OCI> envhp=0x%-07Ix errhp=0x%-07Ix filep=0x%-07Ix dir_alias='%ls', d_length=%d, filename='%ls', f_length=%d\n", OciHandle.HandleValueToTrace(envhp), OciHandle.HandleValueToTrace(errhp), OciHandle.HandleValueToTrace(filep), dir_alias, dir_alias.Length, filename, filename.Length); } byte[] bytes = envhp.GetBytes(dir_alias); ushort length = (ushort)bytes.Length; byte[] fileName = envhp.GetBytes(filename); ushort fileNameLength = (ushort)fileName.Length; int num = filep.OCILobFileSetNameWrapper(envhp, errhp, bytes, length, fileName, fileNameLength); if (Bid.AdvancedOn) { Bid.Trace("<oc.OCILobFileSetName|ADV|OCI|RET> rc=%d\n", num); } return(num); }
internal static int OCILobFileSetName(OciHandle envhp, OciHandle errhp, OciFileDescriptor filep, string dir_alias, string filename) { if (Bid.AdvancedOn) { Bid.Trace("<oc.OCILobFileSetName|ADV|OCI> envhp=0x%-07Ix errhp=0x%-07Ix filep=0x%-07Ix dir_alias='%ls', d_length=%d, filename='%ls', f_length=%d\n", OciHandle.HandleValueToTrace(envhp), OciHandle.HandleValueToTrace(errhp), OciHandle.HandleValueToTrace(filep), dir_alias, dir_alias.Length, filename, filename.Length); } byte[] bytes = envhp.GetBytes(dir_alias); ushort length = (ushort) bytes.Length; byte[] fileName = envhp.GetBytes(filename); ushort fileNameLength = (ushort) fileName.Length; int num = filep.OCILobFileSetNameWrapper(envhp, errhp, bytes, length, fileName, fileNameLength); if (Bid.AdvancedOn) { Bid.Trace("<oc.OCILobFileSetName|ADV|OCI|RET> rc=%d\n", num); } return num; }