Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"The path is too long after being fully qualified"

Status
Not open for further replies.

fadetoblack

Programmer
Jul 19, 2005
19
US
2003 virtual server/asp.net 1.1
The workarounds that I have found aren't working.

\\?\c:\Inetpub\vhosts\intraflux.com\httpdocs\projects\hmgtesting\temp\

.\temp\

and since it's a virtual server I can't set up a drive letter using diskpart

Does anybody know another way of creating a path string to files or a directory?

Thanks in advance
 
I'm unsure how to make the question more clear. Is there any way to create a path to files or a directory that I haven't listed previously. I am using FileInfo and XmlDocument in several pages and am running into the 260 character limit. My problem and question could apply to any class that accesses files or file structure.
 
I'm not creating a directory, I am trying to access one. Specifically this one: c:\Inetpub\vhosts\intraflux.com\httpdocs\projects\hmgtesting\temp\ and I am getting the "The path is too long after being fully qualified" error. Supposedly I have exceeded the 260 character limit. Is there another way I can type the path other than the ones listed above?
 
FileInfo copy_test=new FileInfo(@"C:\Inetpub\vhosts\intraflux.com\httpdocs\projects\hmgtesting\data\master.xml");
 
That seems to work without any errors for me in a simple test:
Code:
[Blue]Imports[/Blue] System.Data
[Blue]Imports[/Blue] System.IO
[Blue]Partial[/Blue] [Blue]Class[/Blue] Default1
    [Blue]Inherits[/Blue] System.Web.UI.Page

    [Blue]Protected[/Blue] [Blue]Sub[/Blue] Page_Load([Blue]ByVal[/Blue] sender [Blue]As[/Blue] Object, [Blue]ByVal[/Blue] e [Blue]As[/Blue] System.EventArgs) [Blue]Handles[/Blue] [Blue]Me[/Blue].Load

        [Blue]Dim[/Blue] ds [Blue]As[/Blue] [Blue]New[/Blue] DataSet
        [Blue]Dim[/Blue] filePath [Blue]As[/Blue] [Blue]String[/Blue] = [Red]"C:\Inetpub\vhosts\intraflux.com\httpdocs\projects\hmgtesting\data"[/Red]
        [Blue]Dim[/Blue] fileName [Blue]As[/Blue] [Blue]String[/Blue] = [Red]"master.xml"[/Red]
        ds.Tables.Add(GetData)
        [Blue]If[/Blue] Directory.Exists(filePath) = [Blue]False[/Blue] [Blue]Then[/Blue]
            Directory.CreateDirectory(filePath)
        [Blue]End[/Blue] [Blue]If[/Blue]
        ds.WriteXml(Path.Combine(filePath, fileName))

        [Blue]Dim[/Blue] copy_test [Blue]As[/Blue] [Blue]New[/Blue] FileInfo(Path.Combine(filePath, fileName))

        Response.Write(copy_test.CreationTime)
    [Blue]End[/Blue] [Blue]Sub[/Blue]

    [Blue]Private[/Blue] [Blue]Function[/Blue] GetData() [Blue]As[/Blue] DataTable
        [Green]' Declarations  [/Green]
        [Blue]Dim[/Blue] dt [Blue]As[/Blue] [Blue]New[/Blue] DataTable
        [Blue]Dim[/Blue] dr [Blue]As[/Blue] DataRow

        [Green]' Add some columns  [/Green]
        dt.Columns.Add([Red]"Column1"[/Red])
        dt.Columns.Add([Red]"Column2"[/Red])

        [Green]' Add some test data  [/Green]
        [Blue]For[/Blue] i [Blue]As[/Blue] [Blue]Integer[/Blue] = 0 [Blue]To[/Blue] 10
            dr = dt.NewRow
            dr([Red]"Column1"[/Red]) = i
            dr([Red]"Column2"[/Red]) = [Red]"Some Text "[/Red] & i
            dt.Rows.Add(dr)
        [Blue]Next[/Blue]

        [Green]' Return the DataTable  [/Green]
        [Blue]Return[/Blue] dt
    [Blue]End[/Blue] [Blue]Function[/Blue]
[Blue]End[/Blue] [Blue]Class[/Blue]


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top