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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cap File : filename lenght

Status
Not open for further replies.

Corwyn

Technical User
Jul 14, 2003
28
0
0
BE
Hi all,

I wrote a script to give an automatic filename to a capture file.
The name I wish (because I must have) contains 11 characters (like: CODyyyymmdd) but system seems to allow only 8 characters lenghtwise filename.

Is it possible to bypass this rule?
 
yes you can bypass the 8 Character rule.
I don't know how many caharcters you can have but I use mine with more than 8, but you can't have spaces. Procomm sees that as a directory change and will error out.

Example:

string fname
fname="MyFileForMe.cap"



To go where no programmer has gone before.
 
No! In this case my file name is an automatic file name. It's a code (FR1 or BE1) with the full date (yyyy/mm/dd). Here is my script:

proc DateName
param string CapFileName

string CapPref, CapDate, TempVar1, TempVar2,TempVar3

CapPref = "FR1" ;Add an argument (simplified here).


TempVar1 = $date ;Get current date.
strextract CapDate TempVar1 "/" 0 ;Get year(yyyy) from date.
strextract TempVar2 TempVar1 "/" 1 ;Get month(mm)from date.
strcat CapDate TempVar2 ;Add month to year.
strextract TempVar3 TempVar1 "/" 2 ;Get day(dd) from date.
strcat CapDate TempVar3 ;Add day to year&month.

CapFileName = CapPref ;Set file name to CapPref.
strcat CapFileName CapDate ;Add date to filename.
strcat CapFileName ".dat" ;Add '.dat' ext to filname.
endproc
It doesn't work because I have more than 8 characters!!!
 
Your script gave the expected result (FR11101703.dat) when I ran it on my machine, so it looks like that procedure is working succesfully. I assume you are using set capture filename in another portion of your script to set the capture file name? Be aware that you cannot include any path information in the set capture file command - it must be a filename only. To set the path, you would use the set capture path command.


aspect@aspectscripting.com
 
Yes I do. My path is defined in another part of my script.
I use Procomm / Aspect 2.11. Is it possible that the script works with newer versions and not with this one?
 
That's very possibly the reason. I don't believe Procomm supported long filenames until it moved into the 32-bit world with version 4.0. I don't think I have version 2.11 installed at home, but I have 3.0 installed on my old NT machine and will try to run your script there tonight if possible.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top