Networking Forums

Networking Forums > Computer Networking > Windows Networking > UNC Path bug ?

Reply
Thread Tools Display Modes

UNC Path bug ?

 
 
Skybuck Flying
Guest
Posts: n/a

 
      06-23-2004, 12:21 AM
Hi,

When I try to create a file on windows 98 like this:

C:\\TEST.ZIP

It says:

'Cannot create file C:\\TEST1.ZIP.'

Partitions are FAT and FAT32

( It does work on windows xp with ntfs and fat32 )

I decided to post it in this newsgroup since it seemed the most suited...
there is no windows98.bugs newsgroup... and I accidently discovered this bug
when trying to save the file to a root folder. Because the way the string
was build it accidently created to slashes... this should however still work
since this conforms to UNC path standard.

( Delphi related )

case1: ExtractFileDir( 'c:\test\test.zip' ) would return 'c:\test' without
slash
case2: ExtractFileDir( 'c:\test.zip' ) would return 'c:\' with slash

The new string would be
case 1: 'c:\test' + '\' + 'test.zip' = 'c:\test\test.zip'
case 2: 'c:\' + '\' + 'test.zip' = 'c:\\test.zip'

So by accident I discovered this.

However case 2 should still work... it does on Windows XP but not on Windows
98

Hmmm

I could easily solve the problem by using ExtractFilePath which always
returns a slash at the end... at least it should if it doesn't I would be
more screwed

Then I would just code:

FilePath + FileName

'c:\' + 'test.zip' = 'c:\test.zip'

However this does not conform with UNC path standard...

The question would be: 'How long will microsoft tolerate
C:\FOLDER\FILENAME.EXT format ?'

I hope the answer would be: 'Forever'

Can't hurt to have some flexiblity

I would ofcourse be still screwed if some other functions would return C:
only without slash

Hmmm, nasty..

Maybe I should just make a (stupid) parse... I-don't-like-parsers.

Or maybe microsoft should make a parser for me =D

Like IsFileNameValid

If it's not valid... what then ? How do I correct it... I still have a
problem then...

Oh well, time to go...

Bye,
Skybuck.


 
Reply With Quote
 
 
 
 
Gerry Voras
Guest
Posts: n/a

 
      06-23-2004, 12:31 AM
This isn't a valid unc path. This is a drive path with an extra (and
erroneous) whack ("\") in it.

"Skybuck Flying" <(E-Mail Removed)> wrote in message
news:cbai74$vaa$(E-Mail Removed)...
> Hi,
>
> When I try to create a file on windows 98 like this:
>
> C:\\TEST.ZIP
>
> It says:
>
> 'Cannot create file C:\\TEST1.ZIP.'
>
> Partitions are FAT and FAT32
>
> ( It does work on windows xp with ntfs and fat32 )
>
> I decided to post it in this newsgroup since it seemed the most suited...
> there is no windows98.bugs newsgroup... and I accidently discovered this

bug
> when trying to save the file to a root folder. Because the way the string
> was build it accidently created to slashes... this should however still

work
> since this conforms to UNC path standard.
>
> ( Delphi related )
>
> case1: ExtractFileDir( 'c:\test\test.zip' ) would return 'c:\test' without
> slash
> case2: ExtractFileDir( 'c:\test.zip' ) would return 'c:\' with slash
>
> The new string would be
> case 1: 'c:\test' + '\' + 'test.zip' = 'c:\test\test.zip'
> case 2: 'c:\' + '\' + 'test.zip' = 'c:\\test.zip'
>
> So by accident I discovered this.
>
> However case 2 should still work... it does on Windows XP but not on

Windows
> 98
>
> Hmmm
>
> I could easily solve the problem by using ExtractFilePath which always
> returns a slash at the end... at least it should if it doesn't I would

be
> more screwed
>
> Then I would just code:
>
> FilePath + FileName
>
> 'c:\' + 'test.zip' = 'c:\test.zip'
>
> However this does not conform with UNC path standard...
>
> The question would be: 'How long will microsoft tolerate
> C:\FOLDER\FILENAME.EXT format ?'
>
> I hope the answer would be: 'Forever'
>
> Can't hurt to have some flexiblity
>
> I would ofcourse be still screwed if some other functions would return C:
> only without slash
>
> Hmmm, nasty..
>
> Maybe I should just make a (stupid) parse... I-don't-like-parsers.
>
> Or maybe microsoft should make a parser for me =D
>
> Like IsFileNameValid
>
> If it's not valid... what then ? How do I correct it... I still have a
> problem then...
>
> Oh well, time to go...
>
> Bye,
> Skybuck.
>
>



 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a

 
      06-23-2004, 09:42 AM
Thanks for pointing out my mistake.

It makes sense now:

unc path is:

\\<server name>\folder

My wacked brain read:

<drive>\\<folder>\<file name>

Funny.

unc paths are apperently about server stuff... not really drives

reminds me of

http:\\www.blabla.com\blabla.html.



"Gerry Voras" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> This isn't a valid unc path. This is a drive path with an extra (and
> erroneous) whack ("\") in it.
>
> "Skybuck Flying" <(E-Mail Removed)> wrote in message
> news:cbai74$vaa$(E-Mail Removed)...
> > Hi,
> >
> > When I try to create a file on windows 98 like this:
> >
> > C:\\TEST.ZIP
> >
> > It says:
> >
> > 'Cannot create file C:\\TEST1.ZIP.'
> >
> > Partitions are FAT and FAT32
> >
> > ( It does work on windows xp with ntfs and fat32 )
> >
> > I decided to post it in this newsgroup since it seemed the most

suited...
> > there is no windows98.bugs newsgroup... and I accidently discovered this

> bug
> > when trying to save the file to a root folder. Because the way the

string
> > was build it accidently created to slashes... this should however still

> work
> > since this conforms to UNC path standard.
> >
> > ( Delphi related )
> >
> > case1: ExtractFileDir( 'c:\test\test.zip' ) would return 'c:\test'

without
> > slash
> > case2: ExtractFileDir( 'c:\test.zip' ) would return 'c:\' with slash
> >
> > The new string would be
> > case 1: 'c:\test' + '\' + 'test.zip' = 'c:\test\test.zip'
> > case 2: 'c:\' + '\' + 'test.zip' = 'c:\\test.zip'
> >
> > So by accident I discovered this.
> >
> > However case 2 should still work... it does on Windows XP but not on

> Windows
> > 98
> >
> > Hmmm
> >
> > I could easily solve the problem by using ExtractFilePath which always
> > returns a slash at the end... at least it should if it doesn't I

would
> be
> > more screwed
> >
> > Then I would just code:
> >
> > FilePath + FileName
> >
> > 'c:\' + 'test.zip' = 'c:\test.zip'
> >
> > However this does not conform with UNC path standard...
> >
> > The question would be: 'How long will microsoft tolerate
> > C:\FOLDER\FILENAME.EXT format ?'
> >
> > I hope the answer would be: 'Forever'
> >
> > Can't hurt to have some flexiblity
> >
> > I would ofcourse be still screwed if some other functions would return

C:
> > only without slash
> >
> > Hmmm, nasty..
> >
> > Maybe I should just make a (stupid) parse... I-don't-like-parsers.
> >
> > Or maybe microsoft should make a parser for me =D
> >
> > Like IsFileNameValid
> >
> > If it's not valid... what then ? How do I correct it... I still have a
> > problem then...
> >
> > Oh well, time to go...
> >
> > Bye,
> > Skybuck.
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
getting path MTU ianbrn@gmail.com Linux Networking 1 08-06-2007 12:44 PM
DFS UNC path tweaking Just Askin Windows Networking 1 07-13-2007 03:53 PM
Is there a path around VPN? Chris F Clark Wireless Internet 22 10-12-2006 11:20 AM
Path too deep Terry Windows Networking 1 11-05-2004 01:23 PM



1 2 3 4 5 6 7 8 9 10 11