Summary: | ghostscript can't handle files with long names/paths | ||
---|---|---|---|
Product: | Ghostscript | Reporter: | Uwe Stöhr <uwestoehr> |
Component: | Graphics Library | Assignee: | Stefan Kemper <stefan.kemper> |
Status: | NOTIFIED FIXED | ||
Severity: | normal | CC: | gsview |
Priority: | P3 | ||
Version: | 8.51 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Customer: | Word Size: | --- | |
Attachments: |
postscript test file
test graphic patch |
Description
Uwe Stöhr
2005-07-08 08:17:39 UTC
Created attachment 1515 [details]
postscript test file
Created attachment 1516 [details]
test graphic
This bug affects also gsview as you can't open attachment 1516 [details] with gsview 4.7.
On my copy of WinXP Pro, I am unable to create a file called: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaatige r.eps I can create file whose name is three characters shorter. The longest file name that I am able to handle with Ghostcript (CVS head) from the command line seems to be 202 characters. Note: gp_file_name_sizeof is defined as 260. I do not know why we cannot handle file names between 202 and 260 characters. >This bug affects also gsview as you can't open attachment 1516 [details] with gsview 4.7. I can open attachment 1516 [details] without problem with 8.51 from the command line. > This bug affects also gsview as you can't open attachment 1516 [details] with gsview 4.7.
GSview 4.7 can open files with names up to 255 characters long.
Note that the file name length includes the path.
Created attachment 1517 [details]
patch
Increade the limit on the .libfile operand length from 200 to the full
gp_file_name_sizeof .
The file system also limits the length of the file name. I used the following
simple program to test the file systems and run time libraries.
#include <stdio.h>
#include <stdlib.h>
int main()
{ int i;
char buf[1024];
for(i=200; i < sizeof(buf); i++)
{ FILE *f;
printf("%d\n",i);
memset(buf, 'a', i);
buf[i] = 0;
f = fopen(buf, "wb");
if(!f)
break;
fclose(f);
}
return 0;
}
The results:
WindowsNT, NTFS, GCC = 243
WindowsNT, NTFS, MSVC = 252
WindowsNT, Samba, GCC = 236, last 5 files cannot be opened on Windows
WindowsNT, Samba, MSVC= 232, last 3 files cannot be opened on Windows
GNU+Linux, ext2, GCC = 255
The patch is committed to the HEAD branch. |