>MAX_PATH itself seems to be an alias from system unit where it is defined accordingly to the operating system (260 on windows, 4096 on Linux, 1024 on BSD, Solaris and Darwin). >It's unlikely, but this way you can end up with the corruption of the byte right after the memory block DefaultFileName is pointing to . This got me thinking. my default filename is just a recommended default. but TFileName.lpstrFile is also what returns the filename to use, and the user could use the save-as dialog to add a directory, and change the name of the file to something else..etc. so the file name could be significantly larger than the default. So I think I'm best off setting TFileName.nMaxFile := Max_Path; then TFileName.lpstrFile will always be able to hold anything the operating system can support. James
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal