Click here to Skip to main content
15,885,782 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have the following code inherited from a c++ DOS file.

C++
_fullpath ( audit_log , filename , 256 ) ;


I need to replace this code so that I can compile in g++ for Linux and found function realpath so intend to make following replacement:

C++
realpath( filename , audit_log );


Can I confirm that:

1. The first two inputs should indeed be reversed.

2. Is there an easy way to specify buffer length of 256 in the realpath function? I think I'm getting errors associated with buffer length using realpath.
Posted

1 solution

1. yes they are reversed.

https://msdn.microsoft.com/en-us/library/506720ff.aspx[^]
http://linux.die.net/man/3/realpath[^]

2. Linux has PATH_MAX and Windows uses _MAX_PATH. You can make char buffer this size.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900