Talk:Open (system call)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

My man page for "open" indicates that the information here on O_CREAT, O_EXCL is incorrect. The information here also ignores the O_TRUNC flag. My understanding is that O_CREAT will not overwrite an existing file. In order to do that you use the O_TRUNC flag. Further, if O_CREAT | O_EXCL is used, the open will fail if the file already exists. Dwkimery 15:37, 23 September 2007 (UTC)[reply]

You're right. I've fixed it. 82.108.130.2 (talk) 18:13, 24 April 2009 (UTC) [mdw][reply]

this open system call can be used for I/O device communication also —Preceding unsigned comment added by 203.101.103.2 (talk) 12:55, 27 August 2009 (UTC)[reply]

Details in Clib posix[edit]

Lets leave all the C details in the referenced C library POSIX page. DG12 (talk) 19:09, 12 August 2011 (UTC)[reply]

What is this article about?[edit]

The article seems to be mainly about the UNIX/POSIX open() system call. We can talk about the abstract concept of "API call to open a file", and UNIX/POSIX open() is one example of that. In C under UNIX/POSIX, fopen() is another, albeit at a higher level of abstraction. But other systems have other file open APIs, e.g. CreateFile and NtCreateFile on Windows (which despite its name actually opens an existing file). I think we should be clear whether we are writing an article about open-in-general or POSIX file descriptor open() in particular. The stuff on Perl is somewhat out of place if the later, since Perl can run on non-POSIX platforms (nowadays mainly Windows, historically several others) in which Perl "open" is not necessarily implemented by the C open() function. If the former, we could talk about "OPEN" statements and calls in many other APIs and languages (C++ std::fstream::open, Java FileInputStream/FileOutputStream/NIO/etc, OPEN statement in BASIC/FORTRAN/COBOL/etc, OPEN macro in IBM MVS assembly, Tcl's open command, MS-DOS Int 21,0F/3D, OS/2 DosOpen, Win16 OpenFile, classic MacOS FSOpenFork, etc).


So I really think there needs to be some clarity about what the actual topic of the article is ("file open" APIs in general vs POSIX open() API call in particular) 180.150.79.82 (talk) 05:55, 3 November 2022 (UTC)[reply]

The page is in the categories Category:C POSIX library and Category:System calls, as are Close (system call)/Read (system call)/Write (system call). So at least it roughly it corresponds to POSIX, but it does seem to have a bit wider scope in it. --Pokechu22 (talk) 06:14, 3 November 2022 (UTC)[reply]