Hi,
I use FSplit, FindFirst, FindNext procedures from the Dos unit in program I'm trying to port for Linux. This procedures cut off the long filenames to 8 characters (DOS standard) and the program doesn't works under Linux correctly. What is possible solutions? What alternative to the Dos unit?
Thanks in advance, Peter
__________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools
On 20 Feb 2004 at 10:50, Peter Norton wrote:
Hi,
I use FSplit, FindFirst, FindNext procedures from the Dos unit in program I'm trying to port for Linux. This procedures cut off the long filenames to 8 characters (DOS standard)
This is news to me. Does the Dos unit really do this?
and the program doesn't works under Linux correctly.
What exactly does this mean in this context?
What is possible solutions? What alternative to the Dos unit?
I think we first need to investigate why you think that the Dos unit truncates the filenames.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/
Prof A Olowofoyeku (The African Chief) wrote:
On 20 Feb 2004 at 10:50, Peter Norton wrote:
Hi,
I use FSplit, FindFirst, FindNext procedures from the Dos unit in program I'm trying to port for Linux. This procedures cut off the long filenames to 8 characters (DOS standard)
This is news to me. Does the Dos unit really do this?
It may do if you set `__BP_TYPE_SIZES__'. I'm not sure (though I wrote the routines ;-) since I've never really used them.
What is possible solutions? What alternative to the Dos unit?
I think we first need to investigate why you think that the Dos unit truncates the filenames.
Some routines (including FSplit) are provided in the GPC unit.
For FindFirst/FindNext I really suggest using OpenDir etc. instead (also GPC unit, see there). FindFirst/FindNext do many things to emulate Dos (more or less) which is extra work in most cases, and not needed even in many Dos programs. (See readdirdemo.pas in demos for a rather simple example on how to use them. Of course OpenDir/ReadDir also work on GPC under Dos (DJGPP).)
Frank
On 21 Feb 2004 at 13:27, Frank Heckenbach wrote:
Prof A Olowofoyeku (The African Chief) wrote:
On 20 Feb 2004 at 10:50, Peter Norton wrote:
Hi,
I use FSplit, FindFirst, FindNext procedures from the Dos unit in program I'm trying to port for Linux. This procedures cut off the long filenames to 8 characters (DOS standard)
This is news to me. Does the Dos unit really do this?
It may do if you set `__BP_TYPE_SIZES__'. I'm not sure (though I wrote the routines ;-) since I've never really used them.
[...]
Well, the relevant parts of my "sysutils" unit (http://gnu- pascal.de/contrib/chief/sysutils/sysutils-20040203.zip) are based on Dos unit routines, and they do not truncate filenames under Linux. I have not tried the "__BP_TYPE_SIZES__" stuff, but I would suppose that if it was defined then long (i.e., >12 chars) filenames would be truncated (in a way that they would not really represent the actualy filename).
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.bigfoot.com/~african_chief/
--- "Prof A Olowofoyeku (The African Chief)" chiefsoft@bigfoot.com wrote:
I use FSplit, FindFirst, FindNext procedures from
the
Dos unit in program I'm trying to port for Linux. This procedures cut off the long filenames to 8 characters (DOS standard)
This is news to me. Does the Dos unit really do this?
(*spliter.pas*) program spliter; uses Dos; var dr : DirStr; fnm : NameStr; ex : ExtStr; begin FSplit(paramstr(1), dr, fnm, ex); writeln(' Path is: '+dr+' File name is :'+fnm+' Extention is: '+ex); end. (*/spliter.pas*)
This program was compiled with GNU Pascal under Linux with -s and -o keys only. Now if I input: #./spliter /mnt/CD/images/MyFavoriteShot.jpg the output is: Path is: /mnt/CD/images/ File name is :MyFavori Extention is: .jpg Please note that MyFavoriteShot was truncated to MyFavori Gues it easy to replicate.
and the program doesn't works under Linux
correctly.
What exactly does this mean in this context?
Simply if I entered the file MyFavoriteShot.jpg for processing it looks for the file named MyFavori.jpg end sends the error message - file doesn't exist.
What is possible solutions? What alternative to
the
Dos unit?
I think we first need to investigate why you think that the Dos unit truncates the filenames.
Because MyFavoriteShot.jpg became MyFavori.jpg after dos's FSplit.
Regards, Peter.
__________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools
Peter Norton wrote:
(*spliter.pas*) program spliter; uses Dos; var dr : DirStr; fnm : NameStr; ex : ExtStr; begin FSplit(paramstr(1), dr, fnm, ex); writeln(' Path is: '+dr+' File name is :'+fnm+' Extention is: '+ex); end. (*/spliter.pas*)
This program was compiled with GNU Pascal under Linux with -s and -o keys only. Now if I input: #./spliter /mnt/CD/images/MyFavoriteShot.jpg the output is: Path is: /mnt/CD/images/ File name is :MyFavori Extention is: .jpg Please note that MyFavoriteShot was truncated to MyFavori Gues it easy to replicate.
That's because `NameStr' has capacity 8 (BP compatible, of course). Try using a longer string (I generally recommend `TString' (unit GPC) for everything unless there are reasons against it).
Frank
david@tcs01.demon.co.uk wrote:
qq88n@yahoo.com wrote:
[snip]
Because MyFavoriteShot.jpg became MyFavori.jpg after dos's FSplit.
If it was returning a DOS 8.3 filename, shouldn't you see something like MyFavo~1.jpg?
That's what would happen when using a Dos file system (also under Linux when mounted as plain FAT instead of VFAT or so ...). But that wasn't the problem. FSplit seems to work right, just the results were truncated because the strings (passed as var parameters for the results) were too small.
Frank