Source language: Translate to:

Is there a limit to the depth a path can have?

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Is there a limit to the depth a path can have?

Postby mejiag » Mon Mar 18, 2013 3:52 pm

Hi, all. I am trying to write the file named GE-Speak-Wagner.wav using the filewrite command. When I give it the following path:

\\files.wedr.edu\studentswork\Language\Tests\CollectionBox\2013\112-01-Smith\Wagner-John\Speak\

Nothing gets written. If, however, I remove the last folder of the path and give it the following path:

\\files.wedr.edu\studentswork\Language\Tests\CollectionBox\2013\112-01-Smith\Wagner-John\

The file gets written no problem.

My question is: is there limit to the length (either in characters or in levels of depth) that a path can have with this command? Also, does filewrite return an error message that can be trapped?

I would appreciate any help with this.
mejiag
 
Posts: 14
Joined: Mon Nov 10, 2008 1:08 pm

Re: Is there a limit to the depth a path can have?

Postby dpayer » Mon Mar 18, 2013 6:27 pm

Two points.

1) try to manually write a file to that same longer path. Is there any problem doing that with another program (example word processor)?

2) try shortening the path with the DOS subst command. You can google it for details. Here is the help:

C:\WINDOWS\system32>subst /?
Associates a path with a drive letter.

SUBST [drive1: [drive2:]path]
SUBST drive1: /D

drive1: Specifies a virtual drive to which you want to assign a path.
[drive2:]path Specifies a physical drive and path you want to assign to
a virtual drive.
/D Deletes a substituted (virtual) drive.



You use this in a batch/cmd file in the following manner: subst "\\files.wedr.edu\studentswork\Language\Tests\CollectionBox\2013\112-01-Smith\Wagner-John\Speak\" d:\myspecialpath

and then write your file to d:\myspecialpath\GE-Speak-Wagner.wav
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Re: Is there a limit to the depth a path can have?

Postby mejiag » Thu Mar 21, 2013 6:48 am

Thank you dpayer. I don't think this solution would work because that shortened path would exist only in the local computer, which would create a problem for distribution of the product.

I still would like to know if there is a limit to the length of a path.
mejiag
 
Posts: 14
Joined: Mon Nov 10, 2008 1:08 pm

Re: Is there a limit to the depth a path can have?

Postby dpayer » Thu Mar 21, 2013 7:17 am

mejiag wrote:Thank you dpayer. I don't think this solution would work because that shortened path would exist only in the local computer, which would create a problem for distribution of the product.

I still would like to know if there is a limit to the length of a path.


Are you attempting to write this file over the internet? If you are, the FileWrite command cannot work, it is intended for Windows based network connections over a LAN. Writing to a server over the internet will require you to use the available functions of that server, be they http-->php/asp upload or FTP.

Regarding length of path, that is determined by the OS. What appears to you as a path to a server resource may actually be using a shortened path (via renamed resource) so efforts to write to it may exceed the limits of the OS even though it looks proper. Typical max path for windows is 260 characters.

http://windows.microsoft.com/en-us/wind ... questions#

I have never run into an issue of path length limits (beyond that of the OS) with NB.

David P.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1384
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest