28 U_ISOFS_SUPER_MAGIC = 0x9660,
29 U_MSDOS_SUPER_MAGIC = 0x4d44,
30 U_NFS_SUPER_MAGIC = 0x6969,
31 U_SMB_SUPER_MAGIC = 0x517B
39 &&
buf.f_type == (
unsigned int) U_ISOFS_SUPER_MAGIC;
50 case U_ISOFS_SUPER_MAGIC:
51 case U_MSDOS_SUPER_MAGIC:
52 case U_NFS_SUPER_MAGIC:
53 case U_SMB_SUPER_MAGIC:
81 for (
int i = 0; i <
confLines.size(); ++i)
85 if (line.startsWith (type))
88 const File f (line.replace (
"$HOME",
File (
"~").getFullPathName())
89 .fromFirstOccurrenceOf (
"=",
false,
false)
100const char*
const* juce_argv =
nullptr;
133 return File (
"/tmp");
137 if (juce_argv !=
nullptr && juce_argc > 0)
145 const auto f = juce_getExecutableFile();
146 return f.isSymbolicLink() ? f.getLinkedTarget() : f;
152 return juce_getExecutableFile();
154 const File f (
"/proc/self/exe");
176 trashCan =
"~/.local/share/Trash/files";
186static bool isFileExecutable (
const String& filename)
199 if (
fileName.startsWithIgnoreCase (
"file:")
207 for (
auto browserName : {
"xdg-open",
"/etc/alternatives/x-www-browser",
"firefox",
"mozilla",
208 "google-chrome",
"chromium-browser",
"opera",
"konqueror" })
213 return cmdLines.joinIntoString (
" || ");
216 return (
fileName.replace (
" ",
"\\ ",
false) +
" " + parameters).trim();
219 const char*
const argv[] = {
"/bin/sh",
"-c",
cmdString.toUTF8(),
nullptr };
Wraps a pointer to a null-terminated UTF-8 character string, and provides various methods to operate ...
Represents a local file or directory.
bool isSymbolicLink() const
Returns true if this file is a link or alias that can be followed using getLinkedTarget().
bool moveFileTo(const File &targetLocation) const
Moves or renames a file.
bool isOnHardDisk() const
Returns true if this file is on a hard disk.
bool isDirectory() const
Checks whether the file is a directory that exists.
bool isOnCDRomDrive() const
Returns true if this file is on a CD or DVD drive.
bool isOnRemovableDrive() const
Returns true if this file is on a removable disk drive.
String getFileExtension() const
Returns the file's extension.
const String & getFullPathName() const noexcept
Returns the complete, absolute path of this file.
void readLines(StringArray &destLines) const
Reads the contents of this file as text and splits it into lines, which are appended to the given Str...
void revealToUser() const
Opens Finder, Explorer, or whatever the OS uses, to show the user this file's location.
String getFileNameWithoutExtension() const
Returns the last part of the filename, without its file extension.
SpecialLocationType
A set of types of location that can be passed to the getSpecialLocation() method.
@ userMoviesDirectory
The most likely place where a user might store their movie files.
@ userMusicDirectory
The most likely place where a user might store their music files.
@ tempDirectory
The folder that should be used for temporary files.
@ globalApplicationsDirectory
The directory in which applications normally get installed.
@ userDocumentsDirectory
The user's default documents folder.
@ currentApplicationFile
Returns this application's location.
@ invokedExecutableFile
Returns the file that was invoked to launch this executable.
@ commonDocumentsDirectory
A place to put documents which are shared by all users of the machine.
@ userApplicationDataDirectory
The folder in which applications store their persistent user-specific settings.
@ userPicturesDirectory
The most likely place where a user might store their picture files.
@ commonApplicationDataDirectory
An equivalent of the userApplicationDataDirectory folder that is shared by all users of the computer,...
@ userDesktopDirectory
The folder that contains the user's desktop objects.
@ hostApplicationPath
In a plugin, this will return the path of the host executable.
@ currentExecutableFile
Returns this application's executable file.
@ userHomeDirectory
The user's home folder.
static File JUCE_CALLTYPE getSpecialLocation(const SpecialLocationType type)
Finds the location of a special type of file or directory, such as a home folder or documents folder.
File getLinkedTarget() const
If this file is a link or alias, this returns the file that it points to.
File getParentDirectory() const
Returns the directory that contains this file or directory.
bool moveToTrash() const
Moves this file or folder to the trash.
File()=default
Creates an (invalid) file object.
String getVersion() const
If possible, this will try to create a version string for the given file.
static File createFileWithoutCheckingPath(const String &absolutePath) noexcept
Creates a file that simply contains this string, without doing the sanity-checking that the normal co...
bool startAsProcess(const String ¶meters=String()) const
Launches the file as a process.
bool exists() const
Checks whether the file actually exists.
static bool JUCE_CALLTYPE openDocument(const String &documentURL, const String ¶meters)
Tries to launch the OS's default reader application for a given file or URL.
A special array for holding a list of strings.
void add(String stringToAdd)
Appends a string at the end of the array.
CharPointer_UTF8 toUTF8() const
Returns a pointer to a UTF-8 version of this string.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...