HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: C fopen
Operating System - OpenVMS
        1839859
        Members
    
    
        2490
        Online
    
    
        110156
        Solutions
    
Forums
        Categories
Company
Local Language
                
                  
                  back
                
        
                
        
                
        
                
        
        
        
                
        
                
        
        
        
                
        
              
              Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
                
                  
                  back
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
                
            
            
                
            
                
            
                
            
                
            
            
                
            
                
            
            
                
            
                
              
            Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
        Information
        Community
Resources
Community Language
        Language
        Forums
Blogs
Topic Options
			
				
					
	
			
		
	- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2004 10:04 PM
07-21-2004 10:04 PM
			
				
					
						
							C fopen
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						Hi,
Can anyone explain me the behavior of the C fopen function?
There is what I mean:
A short C program:
#include
int main ()
{
FILE * f;
f = fopen ("A.TMP","w");
fclose (f);
return 1;
}
I run this program and if I do a directory/full I get:
.
.
Record format: Stream_LF, maximum 0 bytes, longest 32767 bytes
.
.
Then I type:
$ create a.tmp
The dir/full gives me:
.
.
Record format: Variable length, maximum 0 bytes, longest 0 bytes
Ok, another run of the program and dir/full gives me:
.
.
Record format: Variable length, maximum 0 bytes, longest 0 bytes
This means that the record format is obtained from the previous version of the file!
Regards
Bojan
		
		
	
	
	
Can anyone explain me the behavior of the C fopen function?
There is what I mean:
A short C program:
#include
int main ()
{
FILE * f;
f = fopen ("A.TMP","w");
fclose (f);
return 1;
}
I run this program and if I do a directory/full I get:
.
.
Record format: Stream_LF, maximum 0 bytes, longest 32767 bytes
.
.
Then I type:
$ create a.tmp
The dir/full gives me:
.
.
Record format: Variable length, maximum 0 bytes, longest 0 bytes
Ok, another run of the program and dir/full gives me:
.
.
Record format: Variable length, maximum 0 bytes, longest 0 bytes
This means that the record format is obtained from the previous version of the file!
Regards
Bojan
		4 REPLIES 4
	
	            
            
		
		
			
            
                - Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2004 10:13 PM
07-21-2004 10:13 PM
			
				
					
						
							Re: C fopen
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						>
This means that the record format is obtained from the previous version of the file!
<
This is documented behaviour, see
http://h71000.www7.hp.com/commercial/c/docs/5763p027.html#fopen_routine
cu,
Martin
					
				
			
			
				
			
			
				
			
			
			
			
			
			
		
		
		
	
	
	
This means that the record format is obtained from the previous version of the file!
<
This is documented behaviour, see
http://h71000.www7.hp.com/commercial/c/docs/5763p027.html#fopen_routine
cu,
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2004 10:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2004 10:34 PM
07-21-2004 10:34 PM
			
				
					
						
							Re: C fopen
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						Thank you,
I will modify my programs to force the attributes. Another #ifdef __VMS.
Bojan
		
		
	
	
	
I will modify my programs to force the attributes. Another #ifdef __VMS.
Bojan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2004 09:46 AM
07-25-2004 09:46 AM
			
				
					
						
							Re: C fopen
						
					
					
				
			
		
	
			
	
	
	
	
	
			
				
					
					
						Hello Bojan,
one way to minimize this particular ifdef
#ifdef VMS
#define FOPEN_OPT ...
#else
#define FOPEN_OPT ...
#endif
then use the FOPEN_OPT macro in the actual
fopen calls without any ifdefs. This also has the adavantage that if you decided you need to twiddle yet another knob the change is very well localized.
Greetings, Martin
		
		
	
	
	
one way to minimize this particular ifdef
#ifdef VMS
#define FOPEN_OPT ...
#else
#define FOPEN_OPT ...
#endif
then use the FOPEN_OPT macro in the actual
fopen calls without any ifdefs. This also has the adavantage that if you decided you need to twiddle yet another knob the change is very well localized.
Greetings, Martin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
		
	
	
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP
